├── bbk-mss-vue
├── babel.config.js
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── assets
│ │ ├── logo.png
│ │ └── loc_icon.png
│ ├── base
│ │ ├── entity.js
│ │ ├── ele-base.js
│ │ └── utils.js
│ ├── main.js
│ ├── App.vue
│ ├── page
│ │ ├── base
│ │ │ └── 50X.vue
│ │ ├── Login.vue
│ │ └── Main.vue
│ ├── components
│ │ ├── UploadFile.vue
│ │ ├── BaiDuMapTrace.vue
│ │ ├── material
│ │ │ └── catyegory
│ │ │ │ └── NewMaterialCatrgory.vue
│ │ └── BaiDuSelect.vue
│ └── axios
│ │ ├── request.js
│ │ └── api.js
├── .gitignore
├── .yarnrc
├── package.json
└── README.md
├── screenshot
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
├── 7.png
├── 8.png
└── 9.png
├── 基于Vue应急物资保障系统.docx
├── bbk-mss-java
├── bbk-mss-web
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ ├── META-INF
│ │ │ │ │ └── additional-spring-configuration-metadata.json
│ │ │ │ ├── mapper
│ │ │ │ │ ├── MaterialDao.xml
│ │ │ │ │ ├── EventPOMapper.xml
│ │ │ │ │ ├── MaterialCategoryDao.xml
│ │ │ │ │ ├── ApprovalDao.xml
│ │ │ │ │ ├── OperationLogDao.xml
│ │ │ │ │ ├── TransportDao.xml
│ │ │ │ │ └── UserDao.xml
│ │ │ │ ├── templates
│ │ │ │ │ ├── mapper.java.ftl
│ │ │ │ │ ├── mapper.java.vm
│ │ │ │ │ ├── service.java.vm
│ │ │ │ │ ├── service.java.ftl
│ │ │ │ │ ├── mapper.java.btl
│ │ │ │ │ ├── service.java.btl
│ │ │ │ │ ├── serviceImpl.java.vm
│ │ │ │ │ ├── serviceImpl.java.ftl
│ │ │ │ │ ├── serviceImpl.java.btl
│ │ │ │ │ ├── controller.java.vm
│ │ │ │ │ ├── controller.java.btl
│ │ │ │ │ ├── mapper.xml.vm
│ │ │ │ │ ├── mapper.xml.ftl
│ │ │ │ │ ├── mapper.xml.btl
│ │ │ │ │ ├── controller.java.ftl
│ │ │ │ │ ├── entity.kt.vm
│ │ │ │ │ ├── entity.kt.ftl
│ │ │ │ │ ├── entity.kt.btl
│ │ │ │ │ ├── entity.java.vm
│ │ │ │ │ └── entity.java.k.ftl
│ │ │ │ ├── banner.txt
│ │ │ │ ├── WebSocketDemo.html
│ │ │ │ └── application.yaml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── bestbigkk
│ │ │ │ ├── web
│ │ │ │ ├── response
│ │ │ │ │ ├── Result.java
│ │ │ │ │ ├── Tips.java
│ │ │ │ │ ├── annotation
│ │ │ │ │ │ └── RW.java
│ │ │ │ │ ├── handler
│ │ │ │ │ │ └── ResponseWrapper.java
│ │ │ │ │ └── RWrapper.java
│ │ │ │ ├── validator
│ │ │ │ │ ├── LogRecord.java
│ │ │ │ │ ├── AccessLimit.java
│ │ │ │ │ ├── PropertyIn.java
│ │ │ │ │ └── impl
│ │ │ │ │ │ └── PropertyInValidator.java
│ │ │ │ ├── config
│ │ │ │ │ ├── WebSocketConfig.java
│ │ │ │ │ ├── GlobalInit.java
│ │ │ │ │ ├── MybatisPlusConfig.java
│ │ │ │ │ ├── WebMvcConfig.java
│ │ │ │ │ ├── shiro
│ │ │ │ │ │ ├── authc
│ │ │ │ │ │ │ ├── JwtToken.java
│ │ │ │ │ │ │ ├── MyJwtRealm.java
│ │ │ │ │ │ │ └── BaseJwtRealm.java
│ │ │ │ │ │ └── filter
│ │ │ │ │ │ │ └── JwtFilter.java
│ │ │ │ │ ├── RestTemplateConfig.java
│ │ │ │ │ ├── CorsConfig.java
│ │ │ │ │ ├── WithBoot.java
│ │ │ │ │ ├── SwaggerConfig.java
│ │ │ │ │ └── RedisConfig.java
│ │ │ │ ├── controller
│ │ │ │ │ ├── UploadController.java
│ │ │ │ │ ├── VerifyController.java
│ │ │ │ │ ├── ApprovalController.java
│ │ │ │ │ ├── UserController.java
│ │ │ │ │ └── TransportController.java
│ │ │ │ ├── aspect
│ │ │ │ │ ├── impl
│ │ │ │ │ │ ├── AccessLimitAspect.java
│ │ │ │ │ │ ├── LogRecordPersistence.java
│ │ │ │ │ │ └── LogRecordAspect.java
│ │ │ │ │ └── AspectCenter.java
│ │ │ │ └── exception
│ │ │ │ │ └── handler
│ │ │ │ │ └── BaseGlobalExceptionHandler.java
│ │ │ │ └── BBKApplication.java
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── bestbigkk
│ │ │ ├── simple
│ │ │ └── SimpleTest.java
│ │ │ └── boot
│ │ │ └── BootTest.java
│ ├── .gitignore
│ └── pom.xml
├── bbk-mss-common
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── bestbigkk
│ │ │ └── common
│ │ │ ├── utils
│ │ │ ├── BrowserType.java
│ │ │ ├── HttpUtils.java
│ │ │ ├── RequestContextHolderUtils.java
│ │ │ ├── BeanCopyUtils.java
│ │ │ ├── QueryWrapperUtils.java
│ │ │ ├── encryption
│ │ │ │ └── AESUtils.java
│ │ │ └── JwtUtils.java
│ │ │ ├── ListResponse.java
│ │ │ ├── enums
│ │ │ └── Identity.java
│ │ │ ├── web
│ │ │ └── ResultCode.java
│ │ │ ├── config
│ │ │ └── oss
│ │ │ │ └── qiniu
│ │ │ │ ├── QiniuConfig.java
│ │ │ │ └── QiniuBeanConfig.java
│ │ │ ├── exception
│ │ │ └── BusinessException.java
│ │ │ ├── aspect
│ │ │ └── AbstractAspect.java
│ │ │ └── Pagination.java
│ ├── .gitignore
│ └── pom.xml
├── bbk-mss-service
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── bestbigkk
│ │ │ └── service
│ │ │ ├── qiniu
│ │ │ ├── UploadService.java
│ │ │ └── impl
│ │ │ │ └── UploadServiceImpl.java
│ │ │ ├── EventService.java
│ │ │ ├── IUserService.java
│ │ │ ├── IMaterialService.java
│ │ │ ├── ITransportService.java
│ │ │ ├── IOperationLogService.java
│ │ │ ├── IMaterialCategoryService.java
│ │ │ ├── IApprovalService.java
│ │ │ ├── impl
│ │ │ ├── UserServiceImpl.java
│ │ │ ├── EventServiceImpl.java
│ │ │ ├── ApprovalServiceImpl.java
│ │ │ ├── MaterialServiceImpl.java
│ │ │ ├── TransportServiceImpl.java
│ │ │ ├── MaterialCategoryServiceImpl.java
│ │ │ └── OperationLogServiceImpl.java
│ │ │ └── websocket
│ │ │ └── WebSocketServer.java
│ ├── .gitignore
│ └── pom.xml
└── bbk-mss-persistence
│ ├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── bestbigkk
│ │ └── persistence
│ │ ├── dao
│ │ ├── EventDao.java
│ │ ├── ApprovalDao.java
│ │ ├── MaterialDao.java
│ │ ├── TransportDao.java
│ │ ├── MaterialCategoryDao.java
│ │ ├── UserDao.java
│ │ └── OperationLogDao.java
│ │ └── entity
│ │ ├── EventPO.java
│ │ ├── MaterialCategoryPO.java
│ │ ├── OperationLogPO.java
│ │ ├── UserPO.java
│ │ ├── MaterialPO.java
│ │ ├── ApprovalPO.java
│ │ └── TransportPO.java
│ ├── pom.xml
│ └── .gitignore
├── .gitignore
└── README.md
/bbk-mss-vue/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/screenshot/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/1.png
--------------------------------------------------------------------------------
/screenshot/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/2.png
--------------------------------------------------------------------------------
/screenshot/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/3.png
--------------------------------------------------------------------------------
/screenshot/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/4.png
--------------------------------------------------------------------------------
/screenshot/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/5.png
--------------------------------------------------------------------------------
/screenshot/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/6.png
--------------------------------------------------------------------------------
/screenshot/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/7.png
--------------------------------------------------------------------------------
/screenshot/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/8.png
--------------------------------------------------------------------------------
/screenshot/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/screenshot/9.png
--------------------------------------------------------------------------------
/基于Vue应急物资保障系统.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/基于Vue应急物资保障系统.docx
--------------------------------------------------------------------------------
/bbk-mss-vue/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/bbk-mss-vue/public/favicon.ico
--------------------------------------------------------------------------------
/bbk-mss-vue/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/bbk-mss-vue/src/assets/logo.png
--------------------------------------------------------------------------------
/bbk-mss-vue/src/assets/loc_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No180EmergencyMaterialSupportManagementSystem/HEAD/bbk-mss-vue/src/assets/loc_icon.png
--------------------------------------------------------------------------------
/bbk-mss-vue/src/base/entity.js:
--------------------------------------------------------------------------------
1 | //公共对象
2 | const entity = {
3 | pagination:{
4 | currentPage: 1,
5 | pageSize: 10,
6 | total: 0
7 | },
8 | };
9 |
10 | export default entity
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/META-INF/additional-spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties": [
3 | {
4 | "name": "bbk.shiro.enable",
5 | "type": "java.lang.Boolean",
6 | "description": "是否启用Shiro."
7 | }
8 | ] }
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/mapper/MaterialDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/mapper/EventPOMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/mapper/MaterialCategoryDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/response/Result.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.response;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * @author: 开
7 | * @date: 2020-03-23 19:11:45
8 | * @describe: Controller响应实体
9 | */
10 | public interface Result extends Serializable {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/utils/BrowserType.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.utils;
2 |
3 | /**
4 | * @author: 开
5 | * @date: 2020-03-25 15:22:23
6 | * @describe: 浏览器类型
7 | */
8 | public enum BrowserType {
9 | IE11,IE10,IE9,IE8,IE7,IE6,Firefox,Safari,Chrome,Opera,Camino,Gecko
10 | }
11 |
--------------------------------------------------------------------------------
/bbk-mss-vue/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/qiniu/UploadService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.qiniu;
2 |
3 | import com.qiniu.common.QiniuException;
4 |
5 | import java.io.InputStream;
6 |
7 | public interface UploadService {
8 |
9 | String uploadFile(InputStream inputStream, String fileName) throws QiniuException;
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/EventService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.bestbigkk.persistence.entity.EventPO;
5 |
6 | /**
7 | *
8 | * 服务类
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-21
13 | */
14 | public interface EventService extends IService {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/IUserService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.bestbigkk.persistence.entity.UserPO;
5 |
6 | /**
7 | *
8 | * 服务类
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-19
13 | */
14 | public interface IUserService extends IService {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/dao/EventDao.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.dao;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.bestbigkk.persistence.entity.EventPO;
5 |
6 | /**
7 | *
8 | * Mapper 接口
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-21
13 | */
14 | public interface EventDao extends BaseMapper {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/IMaterialService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.bestbigkk.persistence.entity.MaterialPO;
5 |
6 | /**
7 | *
8 | * 服务类
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-19
13 | */
14 | public interface IMaterialService extends IService {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/ITransportService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.bestbigkk.persistence.entity.TransportPO;
5 |
6 | /**
7 | *
8 | * 服务类
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-20
13 | */
14 | public interface ITransportService extends IService {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-vue/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import BaiduMap from 'vue-baidu-map'
3 | import ElementUI from 'element-ui';
4 | import 'element-ui/lib/theme-chalk/index.css';
5 | import App from './App.vue';
6 | import router from '@/router/router'
7 |
8 | Vue.use(ElementUI);
9 | Vue.use(BaiduMap, {
10 | ak: "L0eY0aB9So7nEfQLkLAdG4cHuS9S68Oc"
11 | });
12 |
13 | new Vue({
14 | el: '#app',
15 | router,
16 | render: h => h(App)
17 | });
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/dao/ApprovalDao.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.dao;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.bestbigkk.persistence.entity.ApprovalPO;
5 |
6 | /**
7 | *
8 | * Mapper 接口
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-20
13 | */
14 | public interface ApprovalDao extends BaseMapper {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/dao/MaterialDao.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.dao;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.bestbigkk.persistence.entity.MaterialPO;
5 |
6 | /**
7 | *
8 | * Mapper 接口
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-19
13 | */
14 | public interface MaterialDao extends BaseMapper {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-vue/.yarnrc:
--------------------------------------------------------------------------------
1 | registry "https://registry.npm.taobao.org"
2 | sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
3 | phantomjs_cdnurl "http://cnpmjs.org/downloads"
4 | electron_mirror "https://npm.taobao.org/mirrors/electron/"
5 | sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
6 | profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
7 | chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/dao/TransportDao.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.dao;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.bestbigkk.persistence.entity.TransportPO;
5 |
6 | /**
7 | *
8 | * Mapper 接口
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-20
13 | */
14 | public interface TransportDao extends BaseMapper {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/IOperationLogService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.bestbigkk.persistence.entity.OperationLogPO;
5 |
6 | /**
7 | *
8 | * 操作日志表 服务类
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-03-24
13 | */
14 | public interface IOperationLogService extends IService {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/IMaterialCategoryService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.bestbigkk.persistence.entity.MaterialCategoryPO;
5 |
6 | /**
7 | *
8 | * 服务类
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-19
13 | */
14 | public interface IMaterialCategoryService extends IService {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-vue/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
24 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/dao/MaterialCategoryDao.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.dao;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.bestbigkk.persistence.entity.MaterialCategoryPO;
5 |
6 | /**
7 | *
8 | * Mapper 接口
9 | *
10 | *
11 | * @author xugongkai
12 | * @since 2020-04-19
13 | */
14 | public interface MaterialCategoryDao extends BaseMapper {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/IApprovalService.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.bestbigkk.persistence.entity.ApprovalPO;
5 | import org.springframework.stereotype.Service;
6 |
7 | /**
8 | *
9 | * 服务类
10 | *
11 | *
12 | * @author xugongkai
13 | * @since 2020-04-20
14 | */
15 | public interface IApprovalService extends IService {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/dao/UserDao.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.dao;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.bestbigkk.persistence.entity.UserPO;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | *
9 | * Mapper 接口
10 | *
11 | *
12 | * @author xugongkai
13 | * @since 2020-04-19
14 | */
15 | @Repository
16 | public interface UserDao extends BaseMapper {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/mapper.java.ftl:
--------------------------------------------------------------------------------
1 | package ${package.Mapper};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${superMapperClassPackage};
5 |
6 | /**
7 | *
8 | * ${table.comment!} Mapper 接口
9 | *
10 | *
11 | * @author ${author}
12 | * @since ${date}
13 | */
14 | <#if kotlin>
15 | interface ${table.mapperName} : ${superMapperClass}<${entity}>
16 | <#else>
17 | public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
18 |
19 | }
20 | #if>
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/mapper.java.vm:
--------------------------------------------------------------------------------
1 | package ${package.Mapper};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${superMapperClassPackage};
5 |
6 | /**
7 | *
8 | * $!{table.comment} Mapper 接口
9 | *
10 | *
11 | * @author ${author}
12 | * @since ${date}
13 | */
14 | #if(${kotlin})
15 | interface ${table.mapperName} : ${superMapperClass}<${entity}>
16 | #else
17 | public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
18 |
19 | }
20 | #end
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/service.java.vm:
--------------------------------------------------------------------------------
1 | package ${package.Service};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${superServiceClassPackage};
5 |
6 | /**
7 | *
8 | * $!{table.comment} 服务类
9 | *
10 | *
11 | * @author ${author}
12 | * @since ${date}
13 | */
14 | #if(${kotlin})
15 | interface ${table.serviceName} : ${superServiceClass}<${entity}>
16 | #else
17 | public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
18 |
19 | }
20 | #end
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/service.java.ftl:
--------------------------------------------------------------------------------
1 | package ${package.Service};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${superServiceClassPackage};
5 |
6 | /**
7 | *
8 | * ${table.comment!} 服务类
9 | *
10 | *
11 | * @author ${author}
12 | * @since ${date}
13 | */
14 | <#if kotlin>
15 | interface ${table.serviceName} : ${superServiceClass}<${entity}>
16 | <#else>
17 | public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
18 |
19 | }
20 | #if>
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/mapper.java.btl:
--------------------------------------------------------------------------------
1 | package ${package.Mapper};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${superMapperClassPackage};
5 |
6 | /**
7 | *
8 | * ${table.comment!} Mapper 接口
9 | *
10 | *
11 | * @author ${author}
12 | * @since ${date}
13 | */
14 | <% if(kotlin){ %>
15 | interface ${table.mapperName} : ${superMapperClass}<${entity}>
16 | <% }else{ %>
17 | public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
18 |
19 | }
20 | <% } %>
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/service.java.btl:
--------------------------------------------------------------------------------
1 | package ${package.Service};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${superServiceClassPackage};
5 |
6 | /**
7 | *
8 | * ${table.comment!} 服务类
9 | *
10 | *
11 | * @author ${author}
12 | * @since ${date}
13 | */
14 | <% if(kotlin){ %>
15 | interface ${table.serviceName} : ${superServiceClass}<${entity}>
16 | <% }else{ %>
17 | public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
18 |
19 | }
20 | <% } %>
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/validator/LogRecord.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.validator;
2 |
3 |
4 | import java.lang.annotation.*;
5 |
6 | /**
7 | * @author: 开
8 | * @date: 2020-03-24 14:52:39
9 | * @describe: 使用注解,所以被修饰的方法都会被记录执行记录。
10 | */
11 | @Target( { ElementType.METHOD } )
12 | @Retention( RetentionPolicy.RUNTIME )
13 | @Documented
14 | public @interface LogRecord {
15 |
16 | /**
17 | * 模块名称
18 | */
19 | String modelName() ;
20 |
21 | /**
22 | * 描述.
23 | */
24 | String description() default "";
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/dao/OperationLogDao.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.dao;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.bestbigkk.persistence.entity.OperationLogPO;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | *
9 | * 操作日志表 Mapper 接口
10 | *
11 | *
12 | * @author xugongkai
13 | * @since 2020-03-24
14 | */
15 | @Repository
16 | public interface OperationLogDao extends BaseMapper {
17 |
18 | int countA();
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/test/java/com/bestbigkk/simple/SimpleTest.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.simple;
2 |
3 | import com.bestbigkk.common.web.ResultCode;
4 | import org.junit.Test;
5 |
6 | import java.io.IOException;
7 |
8 | /**
9 | * @author: 开
10 | * @date: 2020-03-24 16:03:36
11 | * @describe: 普通Java测试
12 | */
13 | public class SimpleTest {
14 |
15 | @Test
16 | public void test() throws IOException {
17 | f();
18 | f("1");
19 | }
20 |
21 | public void f(String...a){
22 | System.out.println(a.length);
23 |
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/bbk-mss-vue/src/page/base/50X.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 5 0 0
4 |
5 |
6 |
7 |
8 |
20 |
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/WebSocketConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.socket.server.standard.ServerEndpointExporter;
6 |
7 | /**
8 | * @author: 开
9 | * @date: 2020-03-27 11:46:20
10 | * @describe: WebSocket支持
11 | */
12 | @Configuration
13 | public class WebSocketConfig {
14 | @Bean
15 | public ServerEndpointExporter serverEndpointExporter() {
16 | return new ServerEndpointExporter();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/GlobalInit.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import lombok.extern.slf4j.Slf4j;
4 | import org.springframework.boot.CommandLineRunner;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author: 开
9 | * @date: 2020-03-24 15:54:47
10 | * @describe: 跟随SpringBoot进行初始化,在SpringBoot完全启动之后将触发。
11 | */
12 | @Slf4j
13 | @Configuration
14 | public class GlobalInit implements CommandLineRunner {
15 |
16 | @Override
17 | public void run(String... args) throws Exception {
18 | log.info("伴随启动行为...");
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/ListResponse.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.util.List;
10 |
11 | /**
12 | * @author: 开
13 | * @date: 2020-04-19 20:35:22
14 | * @describe: 公共列表响应对象,会加装一个分页信息
15 | */
16 | @Data
17 | @Builder
18 | @AllArgsConstructor
19 | @NoArgsConstructor
20 | public class ListResponse implements Serializable {
21 |
22 | private List list;
23 | private Pagination pagination;
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/impl/UserServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.impl;
2 |
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 | import com.bestbigkk.persistence.dao.UserDao;
5 | import com.bestbigkk.persistence.entity.UserPO;
6 | import com.bestbigkk.service.IUserService;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * 服务实现类
12 | *
13 | *
14 | * @author xugongkai
15 | * @since 2020-04-19
16 | */
17 | @Service
18 | public class UserServiceImpl extends ServiceImpl implements IUserService {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/response/Tips.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.response;
2 |
3 | /**
4 | * @author: 开
5 | * @date: 2020-03-23 20:10:46
6 | * @describe: 补充信息实体,可以在响应数据的时候,主动向其中设置额外信息,响应包装类会自动作为msg信息返回。
7 | */
8 | public class Tips {
9 | private static final ThreadLocal MSG = new ThreadLocal<>();
10 |
11 | public static String getAndRemove() {
12 | try {
13 | return MSG.get();
14 | }finally {
15 | MSG.remove();
16 | }
17 | }
18 |
19 | public static void set(String content) {
20 | MSG.set(content);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/impl/EventServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.impl;
2 |
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 | import com.bestbigkk.persistence.dao.EventDao;
5 | import com.bestbigkk.persistence.entity.EventPO;
6 | import com.bestbigkk.service.EventService;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * 服务实现类
12 | *
13 | *
14 | * @author xugongkai
15 | * @since 2020-04-21
16 | */
17 | @Service
18 | public class EventServiceImpl extends ServiceImpl implements EventService {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/impl/ApprovalServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.impl;
2 |
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 | import com.bestbigkk.persistence.dao.ApprovalDao;
5 | import com.bestbigkk.persistence.entity.ApprovalPO;
6 | import com.bestbigkk.service.IApprovalService;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * 服务实现类
12 | *
13 | *
14 | * @author xugongkai
15 | * @since 2020-04-20
16 | */
17 | @Service
18 | public class ApprovalServiceImpl extends ServiceImpl implements IApprovalService {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/impl/MaterialServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.impl;
2 |
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 | import com.bestbigkk.persistence.dao.MaterialDao;
5 | import com.bestbigkk.persistence.entity.MaterialPO;
6 | import com.bestbigkk.service.IMaterialService;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * 服务实现类
12 | *
13 | *
14 | * @author xugongkai
15 | * @since 2020-04-19
16 | */
17 | @Service
18 | public class MaterialServiceImpl extends ServiceImpl implements IMaterialService {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/impl/TransportServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.impl;
2 |
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 | import com.bestbigkk.persistence.dao.TransportDao;
5 | import com.bestbigkk.persistence.entity.TransportPO;
6 | import com.bestbigkk.service.ITransportService;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * 服务实现类
12 | *
13 | *
14 | * @author xugongkai
15 | * @since 2020-04-20
16 | */
17 | @Service
18 | public class TransportServiceImpl extends ServiceImpl implements ITransportService {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | bbk-seed
7 | com.bestbigkk
8 | 2.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | ${bbk-persistence-name}
13 | ${bbk-version}
14 | jar
15 |
16 |
17 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/enums/Identity.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.enums;
2 |
3 | /**
4 | * @author: 开
5 | * @date: 2020-04-19 20:01:03
6 | * @describe: 系统身份
7 | */
8 | public enum Identity {
9 |
10 | /**
11 | * 身份
12 | */
13 | EVENT_OPERATOR(1, "应急事件响应工作人员"),
14 | APPROVAL_OPERATOR(2, "审批工作人员"),
15 | MATERIAL_OPERATOR(3, "物资仓储管理人员"),
16 | SYSTEM_OPERATOR(4, "系统运维人员");
17 |
18 | public Integer identityCode;
19 | public String identityName;
20 |
21 | Identity(int identityCode, String identityName) {
22 | this.identityCode = identityCode;
23 | this.identityName = identityName;
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/impl/MaterialCategoryServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.impl;
2 |
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 | import com.bestbigkk.persistence.dao.MaterialCategoryDao;
5 | import com.bestbigkk.persistence.entity.MaterialCategoryPO;
6 | import com.bestbigkk.service.IMaterialCategoryService;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * 服务实现类
12 | *
13 | *
14 | * @author xugongkai
15 | * @since 2020-04-19
16 | */
17 | @Service
18 | public class MaterialCategoryServiceImpl extends ServiceImpl implements IMaterialCategoryService {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/MybatisPlusConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.transaction.annotation.EnableTransactionManagement;
7 |
8 | /**
9 | * @author: 开
10 | * @date: 2020-04-19 20:31:22
11 | * @describe: MybatisPlus配置
12 | */
13 | @Configuration
14 | @EnableTransactionManagement
15 | public class MybatisPlusConfig {
16 |
17 | @Bean
18 | public PaginationInterceptor paginationInterceptor() {
19 | return new PaginationInterceptor();
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/web/ResultCode.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.web;
2 |
3 | /**
4 | * @author: 开
5 | * @date: 2020-03-23 19:16:40
6 | * @describe: 响应状态枚举
7 | */
8 | public enum ResultCode {
9 |
10 | /**
11 | * 正常
12 | */
13 | OK(200, "操作成功!"),
14 | BAD_REQUEST(400, "无效的请求!"),
15 | UN_AUTHORIZATION(401, "身份未认证/权限不足, 请求无法被接受!"),
16 | DENY(403, "操作被禁止!"),
17 | NOT_FOUND(404, "资源未找到"),
18 | BUSINESS(1314, "服务未达到预期!"),
19 | SERVER_ERROR(500, "服务器错误"),
20 | SERVER_BUSY(502, "服务器繁忙");
21 |
22 |
23 |
24 | public int code;
25 | public String msg;
26 |
27 | ResultCode(int i, String s) {
28 | this.code = i;
29 | this.msg = s;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/validator/AccessLimit.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.validator;
2 |
3 | import java.lang.annotation.*;
4 | import java.util.concurrent.TimeUnit;
5 |
6 | /**
7 | * @author: 开
8 | * @date: 2020-03-24 15:05:12
9 | * @describe: 限流增强
10 | */
11 | @Target( { ElementType.METHOD } )
12 | @Retention( RetentionPolicy.RUNTIME )
13 | @Documented
14 | public @interface AccessLimit {
15 |
16 | /**
17 | * 每秒向桶中放入令牌的数量 默认最大即不做限流
18 | * @return
19 | */
20 | double perSecond() default Double.MAX_VALUE;
21 |
22 | /**
23 | * 获取令牌的等待时间 默认0
24 | * @return
25 | */
26 | int timeOut() default 0;
27 |
28 | /**
29 | * 超时时间单位
30 | * @return
31 | */
32 | TimeUnit timeOutUnit() default TimeUnit.SECONDS;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/serviceImpl.java.vm:
--------------------------------------------------------------------------------
1 | package ${package.ServiceImpl};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${package.Mapper}.${table.mapperName};
5 | import ${package.Service}.${table.serviceName};
6 | import ${superServiceImplClassPackage};
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * $!{table.comment} 服务实现类
12 | *
13 | *
14 | * @author ${author}
15 | * @since ${date}
16 | */
17 | @Service
18 | #if(${kotlin})
19 | open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
20 |
21 | }
22 | #else
23 | public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
24 |
25 | }
26 | #end
27 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/serviceImpl.java.ftl:
--------------------------------------------------------------------------------
1 | package ${package.ServiceImpl};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${package.Mapper}.${table.mapperName};
5 | import ${package.Service}.${table.serviceName};
6 | import ${superServiceImplClassPackage};
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * ${table.comment!} 服务实现类
12 | *
13 | *
14 | * @author ${author}
15 | * @since ${date}
16 | */
17 | @Service
18 | <#if kotlin>
19 | open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
20 |
21 | }
22 | <#else>
23 | public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
24 |
25 | }
26 | #if>
27 |
--------------------------------------------------------------------------------
/bbk-mss-vue/src/base/ele-base.js:
--------------------------------------------------------------------------------
1 |
2 | export function resetForm(formName, callBack) {
3 | console.log("重置表单"+formName);
4 | this.$refs[formName].resetFields();
5 | if(callBack!==undefined){
6 | callBack();
7 | }
8 | }
9 |
10 | export function submitForm(formName, validCall, invalidCall) {
11 | this.$refs[formName].validate((valid) => {
12 | console.log("校验表单"+formName);
13 | if (valid) {
14 | if(validCall!==undefined){
15 | validCall();
16 | }
17 | } else {
18 | this.$alert('需要按照规定输入正确的数据才可以提交', '表单校验不通过', {confirmButtonText: '我知道了', type:'warning', showClose:false});
19 | if (invalidCall!==undefined) {
20 | invalidCall();
21 | }
22 | return false;
23 | }
24 | });
25 | }
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/serviceImpl.java.btl:
--------------------------------------------------------------------------------
1 | package ${package.ServiceImpl};
2 |
3 | import ${package.Entity}.${entity};
4 | import ${package.Mapper}.${table.mapperName};
5 | import ${package.Service}.${table.serviceName};
6 | import ${superServiceImplClassPackage};
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | *
11 | * ${table.comment!} 服务实现类
12 | *
13 | *
14 | * @author ${author}
15 | * @since ${date}
16 | */
17 | @Service
18 | <% if(kotlin){ %>
19 | open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
20 |
21 | }
22 | <% }else{ %>
23 | public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
24 |
25 | }
26 | <% } %>
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | out/
12 |
13 | ######################################################################
14 | # IDE
15 |
16 | ### STS ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | nbproject/private/
32 | build/*
33 | nbbuild/
34 | dist/
35 | nbdist/
36 | .nb-gradle/
37 |
38 | ######################################################################
39 | # Others
40 | *.log
41 | *.xml.versionsBackup
42 | *.swp
43 |
44 | !*/build/*.java
45 | !*/build/*.html
46 | !*/build/*.xml
47 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/config/oss/qiniu/QiniuConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.config.oss.qiniu;
2 |
3 | import lombok.Data;
4 | import lombok.extern.slf4j.Slf4j;
5 | import org.springframework.boot.context.properties.ConfigurationProperties;
6 |
7 | import javax.annotation.PostConstruct;
8 |
9 | /**
10 | * @author: 开
11 | * @date: 2020-04-25 12:18:30
12 | * @describe: 七牛云配置
13 | */
14 | @Data
15 | @Slf4j
16 | @ConfigurationProperties(prefix = "bbk.oss.qiniu")
17 | public class QiniuConfig {
18 |
19 | private String accessKey;
20 | private String secretKey;
21 | private String bucket;
22 | private String path;
23 |
24 | @PostConstruct
25 | public void init(){
26 | log.info("加载七牛云配置:" + accessKey + ", " + secretKey + ", " + bucket + ", " + path);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/validator/PropertyIn.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.validator;
2 |
3 | import com.bestbigkk.web.validator.impl.PropertyInValidator;
4 |
5 | import javax.validation.Constraint;
6 | import javax.validation.Payload;
7 | import java.lang.annotation.*;
8 |
9 | /**
10 | * @author: 开
11 | * @date: 2020-01-18 17:27:58
12 | * @describe: 校验给定的字段是否在指定集合
13 | */
14 | @Target({ElementType.FIELD})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Documented
17 | @Constraint(validatedBy = {PropertyInValidator.class})
18 | public @interface PropertyIn {
19 |
20 | String message() default "传递的值不在允许的集合";
21 |
22 | String[] values() default {};
23 |
24 | boolean require() default false;
25 |
26 | Class>[] groups() default {};
27 | Class extends Payload>[] payload() default {};
28 | }
29 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/response/annotation/RW.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.response.annotation;
2 |
3 | import org.springframework.core.annotation.AliasFor;
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 | import org.springframework.web.bind.annotation.RestController;
6 |
7 | import java.lang.annotation.ElementType;
8 | import java.lang.annotation.Retention;
9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 |
12 | /**
13 | * @author: 开
14 | * @date: 2020-01-18 17:30:48
15 | * @describe: 使用该注解,指定响应数据需要进行包装
16 | */
17 | @Retention(RetentionPolicy.RUNTIME)
18 | @Target({ElementType.METHOD, ElementType.TYPE})
19 | @RestController
20 | public @interface RW {
21 |
22 | @AliasFor(annotation = RestController.class)
23 | String value() default "";
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | out/
12 |
13 | ######################################################################
14 | # IDE
15 |
16 | ### STS ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | nbproject/private/
32 | build/*
33 | nbbuild/
34 | dist/
35 | nbdist/
36 | .nb-gradle/
37 |
38 | ######################################################################
39 | # Others
40 | *.log
41 | *.xml.versionsBackup
42 | *.swp
43 |
44 | !*/build/*.java
45 | !*/build/*.html
46 | !*/build/*.xml
47 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | out/
12 |
13 | ######################################################################
14 | # IDE
15 |
16 | ### STS ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | nbproject/private/
32 | build/*
33 | nbbuild/
34 | dist/
35 | nbdist/
36 | .nb-gradle/
37 |
38 | ######################################################################
39 | # Others
40 | *.log
41 | *.xml.versionsBackup
42 | *.swp
43 |
44 | !*/build/*.java
45 | !*/build/*.html
46 | !*/build/*.xml
47 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | out/
12 |
13 | ######################################################################
14 | # IDE
15 |
16 | ### STS ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | nbproject/private/
32 | build/*
33 | nbbuild/
34 | dist/
35 | nbdist/
36 | .nb-gradle/
37 |
38 | ######################################################################
39 | # Others
40 | *.log
41 | *.xml.versionsBackup
42 | *.swp
43 |
44 | !*/build/*.java
45 | !*/build/*.html
46 | !*/build/*.xml
47 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | out/
12 |
13 | ######################################################################
14 | # IDE
15 |
16 | ### STS ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | nbproject/private/
32 | build/*
33 | nbbuild/
34 | dist/
35 | nbdist/
36 | .nb-gradle/
37 |
38 | ######################################################################
39 | # Others
40 | *.log
41 | *.xml.versionsBackup
42 | *.swp
43 |
44 | !*/build/*.java
45 | !*/build/*.html
46 | !*/build/*.xml
47 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/impl/OperationLogServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.impl;
2 |
3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 | import com.bestbigkk.persistence.dao.OperationLogDao;
5 | import com.bestbigkk.persistence.entity.OperationLogPO;
6 | import com.bestbigkk.service.IOperationLogService;
7 | import org.checkerframework.checker.units.qual.A;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.stereotype.Service;
10 |
11 | /**
12 | *
13 | * 操作日志表 服务实现类
14 | *
15 | *
16 | * @author xugongkai
17 | * @since 2020-03-24
18 | */
19 | @Service
20 | public class OperationLogServiceImpl extends ServiceImpl implements IOperationLogService {
21 |
22 | @Autowired
23 | private OperationLogDao operationLogDao;
24 | }
25 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/config/oss/qiniu/QiniuBeanConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.config.oss.qiniu;
2 |
3 | import com.qiniu.common.Zone;
4 | import com.qiniu.util.Auth;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 |
9 | @Configuration
10 | public class QiniuBeanConfig {
11 |
12 | @Autowired
13 | private QiniuConfig qiniuProperties;
14 |
15 | /** 获取七牛云的Configuration */
16 | @Bean
17 | public com.qiniu.storage.Configuration getQiniuConfig() {
18 | return new com.qiniu.storage.Configuration(Zone.zone0());
19 | }
20 |
21 | /** 获取Auth */
22 | @Bean
23 | public Auth getAuth() {
24 | return Auth.create(qiniuProperties.getAccessKey(), qiniuProperties.getSecretKey());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/exception/BusinessException.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.exception;
2 |
3 | import com.bestbigkk.common.web.ResultCode;
4 | import lombok.Data;
5 |
6 | /**
7 | * @author: 开
8 | * @date: 2020-03-24 09:26:55
9 | * @describe: 常规业务异常
10 | */
11 | @Data
12 | public class BusinessException extends RuntimeException {
13 | private ResultCode resultCode;
14 |
15 | public BusinessException(String message) {
16 | super(message);
17 | resultCode = ResultCode.BAD_REQUEST;
18 | }
19 |
20 | public BusinessException(String message, Throwable cause) {
21 | super(message, cause);
22 | resultCode = ResultCode.BAD_REQUEST;
23 | }
24 |
25 | public BusinessException(ResultCode resultCode, String message) {
26 | super(message);
27 | this.resultCode = resultCode == null ? ResultCode.BAD_REQUEST : resultCode;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/aspect/AbstractAspect.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.aspect;
2 |
3 | import org.aspectj.lang.JoinPoint;
4 | import org.springframework.stereotype.Component;
5 |
6 | import java.lang.reflect.Method;
7 |
8 | /**
9 | * @author: 开
10 | * @date: 2020-03-24 15:02:24
11 | * @describe: 切面实现装饰
12 | */
13 |
14 | public abstract class AbstractAspect {
15 |
16 | /**
17 | *
18 | * @param joinPoint
19 | * @param method
20 | * @param throwable
21 | * @return
22 | * @throws Throwable
23 | */
24 | public abstract Object doHandlerAspect(JoinPoint joinPoint, Method method, Throwable throwable) throws Throwable;
25 |
26 | /**
27 | * 执行切面实现类要执行的增强操作
28 | * @param joinPoint
29 | * @param method
30 | * @return
31 | * @throws Throwable
32 | */
33 | public abstract Object execute(JoinPoint joinPoint, Method method, Throwable throwable) throws Throwable;
34 | }
35 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/WebMvcConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.web.servlet.config.annotation.*;
5 |
6 | /**
7 | * @author: 开
8 | * @date: 2020-03-23 19:04:14
9 | * @describe: mvc
10 | */
11 | @Configuration
12 | public class WebMvcConfig extends WebMvcConfigurationSupport {
13 |
14 | @Override
15 | public void addResourceHandlers(ResourceHandlerRegistry registry) {
16 |
17 | ///将该行注释掉就可以保证NoHandlerFoundException异常可以正确抛出,但是可能会造成static下资源无法访问的问题。
18 | ///registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
19 | registry.addResourceHandler("swagger-ui.html")
20 | .addResourceLocations("classpath:/META-INF/resources/");
21 | registry.addResourceHandler("/webjars/**")
22 | .addResourceLocations("classpath:/META-INF/resources/webjars/");
23 | super.addResourceHandlers(registry);
24 |
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/shiro/authc/JwtToken.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config.shiro.authc;
2 |
3 | import com.bestbigkk.common.utils.SnowflakeIdWorker;
4 | import lombok.Data;
5 | import org.apache.shiro.authc.AuthenticationToken;
6 |
7 | import javax.servlet.ServletRequest;
8 |
9 | /**
10 | * @author: 开
11 | * @date: 2020-03-25 17:24:15
12 | * @describe: 令牌
13 | */
14 | @Data
15 | public final class JwtToken implements AuthenticationToken {
16 |
17 | /**在Shiro的Redis缓存管理器中,使用该字段唯一标识*/
18 | private Long id;
19 |
20 | private String token;
21 |
22 | private ServletRequest servletRequest;
23 |
24 | public JwtToken(String token) {
25 | this.token = token;
26 | this.id = SnowflakeIdWorker.nextId();
27 | }
28 |
29 | @Override
30 | public String getPrincipal() {
31 | return token;
32 | }
33 |
34 | @Override
35 | public String getCredentials() {
36 | return token;
37 | }
38 |
39 | public ServletRequest getServletRequest() {
40 | return servletRequest;
41 | }
42 |
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | bbk-seed
7 | com.bestbigkk
8 | 2.0-SNAPSHOT
9 |
10 |
11 | 4.0.0
12 | ${bbk-version}
13 | ${bbk-common-name}
14 | jar
15 |
16 |
17 |
18 | 1.9.12
19 |
20 |
21 |
22 |
23 |
24 | uk.com.robust-it
25 | cloning
26 | ${clone-util.version}
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | bbk-seed
7 | com.bestbigkk
8 | 2.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | ${bbk-service-name}
13 | ${bbk-version}
14 | jar
15 |
16 |
17 |
18 | com.bestbigkk
19 | ${bbk-common-name}
20 | ${bbk-version}
21 |
22 |
23 | com.bestbigkk
24 | ${bbk-persistence-name}
25 | ${bbk-version}
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/controller.java.vm:
--------------------------------------------------------------------------------
1 | package ${package.Controller};
2 |
3 |
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 |
6 | #if(${restControllerStyle})
7 | import org.springframework.web.bind.annotation.RestController;
8 | #else
9 | import org.springframework.stereotype.Controller;
10 | #end
11 | #if(${superControllerClassPackage})
12 | import ${superControllerClassPackage};
13 | #end
14 |
15 | /**
16 | *
17 | * $!{table.comment} 前端控制器
18 | *
19 | *
20 | * @author ${author}
21 | * @since ${date}
22 | */
23 | #if(${restControllerStyle})
24 | @RestController
25 | #else
26 | @Controller
27 | #end
28 | @RequestMapping("#if(${package.ModuleName})/${package.ModuleName}#end/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end")
29 | #if(${kotlin})
30 | class ${table.controllerName}#if(${superControllerClass}) : ${superControllerClass}()#end
31 |
32 | #else
33 | #if(${superControllerClass})
34 | public class ${table.controllerName} extends ${superControllerClass} {
35 | #else
36 | public class ${table.controllerName} {
37 | #end
38 |
39 | }
40 |
41 | #end
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/mapper/ApprovalDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | id, title, content, create_time, last_update_time, level, status, approval_user_id, material_apply
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/bbk-mss-vue/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/banner.txt:
--------------------------------------------------------------------------------
1 | ${AnsiColor.BRIGHT_YELLOW}
2 | ////////////////////////////////////////////////////////////////////
3 |
4 | _ooOoo_
5 | o8888888o
6 | 88" . "88
7 | (| -_- |)
8 | O\ = /O
9 | ____/`---'\____
10 | .' \\| |// `.
11 | / \\||| : |||// \
12 | / _||||| -:- |||||- \
13 | | | \\\ - /// | |
14 | | \_| ''\---/'' | |
15 | \ .-\__ `-` ___/-. /
16 | ___`. .' /--.--\ `. . __
17 | ."" '< `.___\_<|>_/___.' >'"".
18 | | | : `- \`.;`\ _ /`;.`/ - ` : | |
19 | \ \ `-. \_ __\ /__ _/ .-` / /
20 | ======`-.____`-.___\_____/___.-`____.-'======
21 | `=---='
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 | BestBigKK-MaterialSupportSystem
24 | // 佛祖保佑 永不宕机 永无BUG //
25 |
26 | ////////////////////////////////////////////////////////////////////
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/utils/HttpUtils.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.utils;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 |
5 | public class HttpUtils {
6 |
7 | private static final String UNKNOWN = "unknown";
8 |
9 | public static String getIpAddress(HttpServletRequest request) {
10 | String ip = request.getHeader("x-forwarded-for");
11 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
12 | ip = request.getHeader("Proxy-Client-IP");
13 | }
14 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
15 | ip = request.getHeader("WL-Proxy-Client-IP");
16 | }
17 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
18 | ip = request.getHeader("HTTP_CLIENT_IP");
19 | }
20 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
21 | ip = request.getHeader("HTTP_X_FORWARDED_FOR");
22 | }
23 | if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
24 | ip = request.getRemoteAddr();
25 | }
26 | return ip+":"+request.getRemotePort();
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/validator/impl/PropertyInValidator.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.validator.impl;
2 |
3 | import com.bestbigkk.web.validator.PropertyIn;
4 | import org.springframework.util.StringUtils;
5 |
6 | import javax.validation.ConstraintValidator;
7 | import javax.validation.ConstraintValidatorContext;
8 |
9 | /**
10 | * @author: 开
11 | * @date: 2020-01-18 17:27:25
12 | * @describe: 校验给定字段是否在允许的集合里面实现
13 | */
14 | public class PropertyInValidator implements ConstraintValidator {
15 |
16 | private PropertyIn propertyIn;
17 |
18 | @Override
19 | public void initialize(PropertyIn constraintAnnotation) {
20 | this.propertyIn = constraintAnnotation;
21 | }
22 |
23 | @Override
24 | public boolean isValid(String value, ConstraintValidatorContext context) {
25 | boolean empty = StringUtils.isEmpty(value);
26 | if (empty) {
27 | return !propertyIn.require();
28 | }
29 | String[] values = propertyIn.values();
30 | for (String property : values) {
31 | if (property.equals(value)) {
32 | return true;
33 | }
34 | }
35 | return false;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/RestTemplateConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import io.swagger.models.auth.In;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.http.client.ClientHttpRequestFactory;
7 | import org.springframework.http.client.SimpleClientHttpRequestFactory;
8 | import org.springframework.web.client.RestTemplate;
9 |
10 | /**
11 | * @author: 开
12 | * @date: 2020-03-25 15:37:09
13 | * @describe: resetTemplate配置
14 | */
15 | @Configuration
16 | public class RestTemplateConfig {
17 |
18 | private static final Integer READ_TIMEOUT = 5000;
19 | private static final Integer CONNECT_TIMEOUT = 15000;
20 |
21 |
22 | @Bean
23 | public RestTemplate restTemplate(ClientHttpRequestFactory factory){
24 | return new RestTemplate(factory);
25 | }
26 | @Bean
27 | public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
28 | SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
29 | factory.setConnectTimeout(CONNECT_TIMEOUT);
30 | factory.setReadTimeout(READ_TIMEOUT);
31 | return factory;
32 | }
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/mapper/OperationLogDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | id, model_name, action_args, create_time, log_description, log_location, log_status, error_msg
20 |
21 |
22 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/controller.java.btl:
--------------------------------------------------------------------------------
1 | package ${package.Controller};
2 |
3 |
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 |
6 | <% if(restControllerStyle){ %>
7 | import org.springframework.web.bind.annotation.RestController;
8 | <% }else{ %>
9 | import org.springframework.stereotype.Controller;
10 | <% } %>
11 | <% if(isNotEmpty(superControllerClassPackage)){ %>
12 | import ${superControllerClassPackage};
13 | <% } %>
14 |
15 | /**
16 | *
17 | * ${table.comment!} 前端控制器
18 | *
19 | *
20 | * @author ${author}
21 | * @since ${date}
22 | */
23 | <% if(restControllerStyle){ %>
24 | @RestController
25 | <% }else{ %>
26 | @Controller
27 | <% } %>
28 | @RequestMapping("<% if(isNotEmpty(package.ModuleName)){ %>/${package.ModuleName}<% } %>/<% if(isNotEmpty(controllerMappingHyphenStyle)){ %>${controllerMappingHyphen}<% }else{ %>${table.entityPath}<% } %>")
29 | <% if(kotlin){ %>
30 | class ${table.controllerName}<% if(isNotEmpty(superControllerClass)){ %> : ${superControllerClass}()<% } %>
31 | <% }else{ %>
32 | <% if(isNotEmpty(superControllerClass)){ %>
33 | public class ${table.controllerName} extends ${superControllerClass} {
34 | <% }else{ %>
35 | public class ${table.controllerName} {
36 | <% } %>
37 |
38 | }
39 | <% } %>
40 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/mapper.xml.vm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #if(${enableCache})
6 |
7 |
8 |
9 | #end
10 | #if(${baseResultMap})
11 |
12 |
13 | #foreach($field in ${table.fields})
14 | #if(${field.keyFlag})##生成主键排在第一位
15 |
16 | #end
17 | #end
18 | #foreach($field in ${table.commonFields})##生成公共字段
19 |
20 | #end
21 | #foreach($field in ${table.fields})
22 | #if(!${field.keyFlag})##生成普通字段
23 |
24 | #end
25 | #end
26 |
27 |
28 | #end
29 | #if(${baseColumnList})
30 |
31 |
32 | #foreach($field in ${table.commonFields})
33 | ${field.name},
34 | #end
35 | ${table.fieldNames}
36 |
37 |
38 | #end
39 |
40 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/mapper.xml.ftl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <#if enableCache>
6 |
7 |
8 |
9 | #if>
10 | <#if baseResultMap>
11 |
12 |
13 | <#list table.fields as field>
14 | <#if field.keyFlag><#--生成主键排在第一位-->
15 |
16 | #if>
17 | #list>
18 | <#list table.commonFields as field><#--生成公共字段 -->
19 |
20 | #list>
21 | <#list table.fields as field>
22 | <#if !field.keyFlag><#--生成普通字段 -->
23 |
24 | #if>
25 | #list>
26 |
27 |
28 | #if>
29 | <#if baseColumnList>
30 |
31 |
32 | <#list table.commonFields as field>
33 | ${field.name},
34 | #list>
35 | ${table.fieldNames}
36 |
37 |
38 | #if>
39 |
40 |
--------------------------------------------------------------------------------
/bbk-mss-vue/src/components/UploadFile.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 将文件拖到此处,或点击上传
6 | 只能上传jpg/png文件,且不超过500kb
7 |
8 |
9 |
10 |
11 |
38 |
39 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/mapper/TransportDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | id, approval_id, create_time, expect_time, create_user_id, transport_record, material_record, status, receiver_user_id, transport_type
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/mapper/UserDao.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | id, account, password, salt, nick_name, sex, picture, address, identity_code, identity_name, create_time, enable
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/utils/RequestContextHolderUtils.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.utils;
2 |
3 | import org.springframework.web.context.ContextLoader;
4 | import org.springframework.web.context.request.RequestContextHolder;
5 | import org.springframework.web.context.request.ServletRequestAttributes;
6 |
7 | import javax.servlet.ServletContext;
8 | import javax.servlet.http.HttpServletRequest;
9 | import javax.servlet.http.HttpServletResponse;
10 | import javax.servlet.http.HttpSession;
11 |
12 | /**
13 | * @author: 开
14 | * @date: 2020-03-23 19:31:21
15 | * @describe: web域对象快速获取
16 | */
17 | public class RequestContextHolderUtils {
18 |
19 | public static HttpServletRequest getRequest() {
20 | return getRequestAttributes().getRequest();
21 | }
22 |
23 | public static HttpServletResponse getResponse() {
24 | return getRequestAttributes().getResponse();
25 | }
26 |
27 | public static HttpSession getSession() {
28 | return getRequest().getSession();
29 | }
30 |
31 | public static ServletRequestAttributes getRequestAttributes() {
32 | return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes());
33 | }
34 |
35 | public static ServletContext getServletContext() {
36 | return ContextLoader.getCurrentWebApplicationContext().getServletContext();
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/templates/mapper.xml.btl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <% if(enableCache){ %>
6 |
7 |
8 |
9 | <% } %>
10 | <% if(baseResultMap){ %>
11 |
12 |
13 | <% for(field in table.fields){ %>
14 | <% /** 生成主键排在第一位 **/ %>
15 | <% if(field.keyFlag){ %>
16 |
17 | <% } %>
18 | <% } %>
19 | <% for(field in table.commonFields){ %>
20 | <% /** 生成公共字段 **/ %>
21 |
22 | <% } %>
23 | <% for(field in table.fields){ %>
24 | <% /** 生成普通字段 **/ %>
25 | <% if(!field.keyFlag){ %>
26 |
27 | <% } %>
28 | <% } %>
29 |
30 | <% } %>
31 | <% if(baseColumnList){ %>
32 |
33 |
34 | <% for(field in table.commonFields){ %>
35 | ${field.name},
36 | <% } %>
37 | ${table.fieldNames}
38 |
39 |
40 | <% } %>
41 |
42 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/CorsConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.cors.CorsConfiguration;
6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7 | import org.springframework.web.filter.CorsFilter;
8 |
9 | /**
10 | * @author: 开
11 | * @date: 2020-03-24 15:26:10
12 | * @describe: 跨域
13 | */
14 | @Configuration
15 | public class CorsConfig {
16 | private CorsConfiguration buildConfig() {
17 | CorsConfiguration corsConfiguration = new CorsConfiguration();
18 | // 1允许服务端访问
19 | corsConfiguration.addAllowedOrigin("*");
20 | // 1.1允许本地访问
21 | corsConfiguration.addAllowedOrigin("http://localhost:8848");
22 | // 2允许任何头
23 | corsConfiguration.addAllowedHeader("*");
24 | // 3允许任何方法(post、get等)
25 | corsConfiguration.addAllowedMethod("*");
26 | // 4 允许withCredentials报文头
27 | corsConfiguration.setAllowCredentials(true);
28 | return corsConfiguration;
29 | }
30 |
31 | @Bean
32 | public CorsFilter corsFilter() {
33 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
34 | source.registerCorsConfiguration("/**", buildConfig());
35 | return new CorsFilter(source);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/bbk-mss-vue/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "material-support-system-rebuild-vue",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "npx vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.19.2",
12 | "core-js": "^3.6.4",
13 | "element-ui": "^2.13.1",
14 | "qs": "^6.9.3",
15 | "vue": "^2.6.11",
16 | "vue-axios": "^2.1.5",
17 | "vue-baidu-map": "^0.21.22",
18 | "vue-router": "^3.1.6"
19 | },
20 | "devDependencies": {
21 | "@vue/cli-plugin-babel": "~4.3.0",
22 | "@vue/cli-plugin-eslint": "~4.3.0",
23 | "@vue/cli-service": "~4.3.0",
24 | "babel-eslint": "^10.1.0",
25 | "eslint": "^6.7.2",
26 | "eslint-plugin-vue": "^6.2.2",
27 | "vue-template-compiler": "^2.6.11"
28 | },
29 | "eslintConfig": {
30 | "root": true,
31 | "env": {
32 | "node": true
33 | },
34 | "extends": [
35 | "plugin:vue/essential",
36 | "eslint:recommended"
37 | ],
38 | "parserOptions": {
39 | "parser": "babel-eslint"
40 | },
41 | "rules": {
42 | "generator-star-spacing": "off",
43 | "no-tabs": "off",
44 | "no-unused-vars": "off",
45 | "no-console": "off",
46 | "no-irregular-whitespace": "off",
47 | "no-debugger": "off"
48 | }
49 | },
50 | "browserslist": [
51 | "> 1%",
52 | "last 2 versions",
53 | "not dead"
54 | ]
55 | }
56 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/controller/UploadController.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.controller;
2 |
3 | import com.bestbigkk.common.exception.BusinessException;
4 | import com.bestbigkk.service.qiniu.UploadService;
5 | import com.bestbigkk.web.response.annotation.RW;
6 | import io.swagger.annotations.Api;
7 | import io.swagger.annotations.ApiOperation;
8 | import lombok.extern.slf4j.Slf4j;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.web.bind.annotation.PostMapping;
11 | import org.springframework.web.bind.annotation.RequestMapping;
12 | import org.springframework.web.bind.annotation.RestController;
13 | import org.springframework.web.multipart.MultipartFile;
14 |
15 | import java.io.IOException;
16 | import java.util.Objects;
17 |
18 | @Slf4j
19 | @RW
20 | @RequestMapping(value = "/dev/qiniu", produces = {"application/json;charset=UTF-8"})
21 | @Api(tags = "七牛云SSO上传接口")
22 | public class UploadController {
23 |
24 | @Autowired
25 | private UploadService uploadService;
26 |
27 | @PostMapping(value = "/upload")
28 | @ApiOperation("上传SSO文件")
29 | public String upload(MultipartFile file) {
30 | if (Objects.isNull(file)) {
31 | throw new BusinessException("请提供要上传的文件");
32 | }
33 | try {
34 | return uploadService.uploadFile(file.getInputStream(), file.getOriginalFilename());
35 | } catch (IOException e) {
36 | log.error("七牛云上传错误", e);
37 | }
38 | throw new BusinessException("上传失败,请稍候重试!");
39 | }
40 |
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/WithBoot.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import com.bestbigkk.common.utils.RedisUtils;
4 | import lombok.Getter;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.beans.factory.annotation.Value;
8 | import org.springframework.boot.CommandLineRunner;
9 | import org.springframework.stereotype.Component;
10 | import springfox.documentation.builders.ApiInfoBuilder;
11 | import springfox.documentation.service.ApiInfo;
12 | import springfox.documentation.spring.web.plugins.Docket;
13 |
14 | import java.util.Objects;
15 |
16 | /**
17 | * @author: 开
18 | * @date: 2020-04-19 19:30:14
19 | * @describe: 伴随启动
20 | */
21 | @Slf4j
22 | @Component
23 | public class WithBoot implements CommandLineRunner {
24 |
25 | @Getter
26 | @Value("${server.servlet.application-display-name}")
27 | private String applicationName;
28 |
29 | @Autowired
30 | private RedisUtils redisUtils;
31 |
32 | private final String machineCountFlag = applicationName + ":machineCountFlag";
33 |
34 | @Override
35 | public void run(String... args) {
36 | Object count = redisUtils.get(machineCountFlag);
37 | int no = 1;
38 | if (Objects.isNull(count)) {
39 | redisUtils.set(machineCountFlag, 1);
40 | } else {
41 | redisUtils.incr(machineCountFlag, 1);
42 | no = Integer.parseInt(count+"") + 1;
43 | }
44 | applicationName += "_node_" + no;
45 | log.info("成功分配机器编号:{}", applicationName);
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/bbk-mss-vue/src/base/utils.js:
--------------------------------------------------------------------------------
1 | //合并source对象的属性到target
2 | export function mergeBean(source, target) {
3 | if(source===undefined){
4 | return target;
5 | }
6 | if(target===undefined){
7 | return source;
8 | }
9 | for(const i in source){
10 | target[i] = source[i];
11 | }
12 | return target;
13 | }
14 |
15 | export function dateFormat(value, format) {
16 | if (typeof(value) == "undefined" || value == null || value == '') {
17 | return value;
18 | }
19 | const date = new Date(value);
20 | format = format || 'yyyy-MM-dd';
21 | const o = {
22 | "M+": date.getMonth() + 1, //month
23 | "d+": date.getDate(), //day
24 | "h+": date.getHours(), //hour
25 | "m+": date.getMinutes(), //minute
26 | "s+": date.getSeconds(), //second
27 | "q+": Math.floor((date.getMonth() + 3) / 3), //quarter
28 | "S": date.getMilliseconds() //millisecond
29 | };
30 | if (/(y+)/.test(format)) {
31 | format = format.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
32 | }
33 | for (const k in o){
34 | if (new RegExp("(" + k + ")").test(format)){
35 | format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
36 | }
37 | }
38 | return format;
39 | }
40 |
41 | export function isNull(o) {
42 | return o === undefined || o === null || o === "";
43 | }
44 |
45 | export function isIdentity(code) {
46 | return this.$user.identityCode === code;
47 | }
48 |
49 | export function isNotIdentity(code) {
50 | return this.$user.identityCode !== code;
51 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 180.应急物资保障管理系统
2 |
3 | - 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/))
4 | - 技术探讨、资料分享,请加QQ群:692619798
5 | - 作者微信:19941326836 QQ:952045282
6 | - 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习
7 | - 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务
8 | - 所有选题地址 ([https://github.com/YuLin-Coder/AllProjectCatalog](https://github.com/YuLin-Coder/AllProjectCatalog))
9 |
10 |
11 | ## 项目介绍
12 | 基于springboot+vue的应急物资保障管理系统【含报告】:前端 vue、elementui,后端 maven、springmvc、spring、mybatis;角色分为管理员、应急事件响应人员、运输人员、审批人员;集成应急物资、应急事件、审批、应急物资运输等功能于一体的系统。
13 |
14 |
15 | ## 功能模块概述
16 |
17 | 1. 应急物资,应急物资分类管理模块:
18 | 该模块主要是对应急物资以及其分类进行统一的管理,包含对应急物资的新增,支出,信息更新,删除。并提供了多种筛选方式可以边快速的获取到应急物资的当前情况。针对物资分类也提供了类似的功能。
19 | 2. 应急事件管理模块:
20 | 该模块作为应急物资调度的先导而存在,可以通过该模块进行应急事件的建立,维护,并可以按照实际生活中的处理进度,更新某个应急事件的处理状态。进行统一的跟进,同时可以在该界面获取到历史的应急事件以及其处理状态,通过多种方式筛选出指定的数据,然后提供了针对某一个应急事件的物资申请发起的功能,可以为这个事件申请物资。
21 | 3. 审批模块:
22 | 该模块主要是配合应急事件管理模块,对来自该模块下建立的申请进行审批,结合实际的情况进行处理,选择通过审批或者驳回。只有经过审批之后,相关的流程才可以继续流转下去。
23 | 4. 应急物资运输模块:
24 | 通过该模块可以对已经通过审批的申请建立物资运输单,进而对申请的物资进行运输工作,并且可以在这个过程中对其进行物资的流转等操作,应急事件管理人员也可以在该模块下选择结束流转一个运输单,表示已经收到了物资。
25 | 5. 系统模块:
26 | 通过该模块对用户的信息进行管理,进行登录验证,用户权限判断等操作,并且按照用户的身份为其生成菜单。并记录其操作日志。
27 |
28 | ## 环境
29 |
30 | - IntelliJ IDEA 2021.3
31 |
32 | - Mysql 5.7.26
33 |
34 | - Node 14.14.0
35 |
36 | - Redis 3.0
37 |
38 | - JDK 1.8
39 |
40 | ## 运行截图
41 | 
42 |
43 | 
44 |
45 | 
46 |
47 | 
48 |
49 | 
50 |
51 | 
52 |
53 | 
54 |
55 | 
56 |
57 | 
58 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/Pagination.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common;
2 |
3 | import com.baomidou.mybatisplus.core.metadata.IPage;
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 | import io.swagger.annotations.ApiModelProperty;
6 | import lombok.AllArgsConstructor;
7 | import lombok.Data;
8 | import lombok.NoArgsConstructor;
9 |
10 | import java.util.Arrays;
11 | import java.util.Objects;
12 |
13 | /**
14 | * @author: 开
15 | * @date: 2020-04-19 20:14:58
16 | * @describe: 分页对象
17 | */
18 | @Data
19 | @NoArgsConstructor
20 | public class Pagination {
21 |
22 | @ApiModelProperty("当前页数")
23 | private Long currentPage;
24 |
25 | @ApiModelProperty("页容量")
26 | private Long pageSize;
27 |
28 | @ApiModelProperty("记录总数")
29 | private Long total;
30 |
31 | public Pagination(long currentPage, long pageSize) {
32 | this.currentPage = currentPage;
33 | this.pageSize = pageSize;
34 | }
35 |
36 | public Page toPage(String...descColumnNames) {
37 | Page page = new Page<>();
38 | page.setCurrent(this.currentPage==null ? 1 : this.currentPage);
39 | page.setSize(this.pageSize==null ? 10 : this.pageSize);
40 | page.setTotal(this.total == null ? 0 : this.total);
41 | page.setDescs(Arrays.asList(descColumnNames));
42 | return page;
43 | }
44 |
45 | public Pagination toPagination(IPage page) {
46 | if (Objects.isNull(page)) {
47 | return new Pagination<>(1, 10);
48 | }
49 |
50 | Pagination pagination = new Pagination<>(page.getCurrent(), page.getSize());
51 | pagination.setTotal(page.getTotal());
52 | return pagination;
53 |
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/test/java/com/bestbigkk/boot/BootTest.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.boot;
2 |
3 | import com.baomidou.mybatisplus.core.metadata.IPage;
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 | import com.bestbigkk.BBKApplication;
6 | import com.bestbigkk.common.Pagination;
7 | import com.bestbigkk.common.utils.encryption.AESUtils;
8 | import com.bestbigkk.persistence.dao.UserDao;
9 | import com.bestbigkk.persistence.entity.UserPO;
10 | import com.bestbigkk.service.IUserService;
11 | import com.bestbigkk.web.config.WebSocketConfig;
12 | import lombok.extern.slf4j.Slf4j;
13 | import org.junit.runner.RunWith;
14 | import org.springframework.beans.factory.annotation.Autowired;
15 | import org.springframework.boot.test.context.SpringBootTest;
16 | import org.springframework.test.context.junit4.SpringRunner;
17 |
18 | /**
19 | * @author: 开
20 | * @date: 2020-03-24 16:03:20
21 | * @describe: SpringBoot单元测试
22 | */
23 | @Slf4j
24 | @RunWith(SpringRunner.class)
25 | @SpringBootTest(classes = BBKApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
26 | public class BootTest {
27 |
28 | @Autowired
29 | IUserService userService;
30 | @Autowired
31 | UserDao userDao;
32 |
33 | @org.junit.Test
34 | public void test() {
35 | final IPage page = userService.page(new Pagination(1, 1).toPage());
36 | log.info("{}", page.getRecords());
37 |
38 | final IPage page1 = userService.page(new Page(1, 1));
39 | log.info("{}", page1.getRecords());
40 |
41 | final IPage page2 = userDao.selectPage(new Pagination(1,1).toPage(), null);
42 | log.info("{}", page2.getRecords());
43 |
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/BBKApplication.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk;
2 |
3 | import com.bestbigkk.common.config.oss.qiniu.QiniuConfig;
4 | import org.mybatis.spring.annotation.MapperScan;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
8 | import org.springframework.context.ConfigurableApplicationContext;
9 | import org.springframework.core.env.Environment;
10 | import org.springframework.scheduling.annotation.EnableAsync;
11 |
12 | import java.net.InetAddress;
13 | import java.net.UnknownHostException;
14 |
15 | /**
16 | * @author: 开
17 | * @date: 2020-03-23 15:23:53
18 | * @describe: bestbigkk
19 | */
20 | @SpringBootApplication
21 | @EnableAsync
22 | @MapperScan(basePackages = "com.bestbigkk.persistence.dao")
23 | @EnableConfigurationProperties(value = {QiniuConfig.class})
24 | public class BBKApplication {
25 | public static void main(String[] args) throws UnknownHostException {
26 | ConfigurableApplicationContext application = SpringApplication.run(BBKApplication.class, args);
27 |
28 | //常规信息
29 | Environment env = application.getEnvironment();
30 | String ip = InetAddress.getLocalHost().getHostAddress();
31 | String port = env.getProperty("server.port");
32 | String path = env.getProperty("server.servlet.context-path");
33 |
34 | System.out.println("------------");
35 | System.out.println("IP : " + ip);
36 | System.out.println("Port: " + port);
37 | System.out.println("Path: " + path);
38 | System.out.println("------------");
39 | }
40 |
41 | //TODO: 应用下线之后,更新Redis中机器数量标识。
42 | }
43 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/resources/WebSocketDemo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | My WebSocket
5 |
6 |
7 |
8 | Welcome to WebSocket Demo!
9 |
10 |
11 |
12 |
13 |
64 |
--------------------------------------------------------------------------------
/bbk-mss-vue/README.md:
--------------------------------------------------------------------------------
1 | # 应急物资保障系统-(毕设)
2 |
3 | > 该系统为应急物资保障系统的前端模块。后端模块请参考:bbk-mss-java
4 |
5 | > 系统简述:模拟应急事件发生时,从事件建立, 物资申请,物资审批,物资流转等所有流程。
6 |
7 | 基于Vue开发,使用Element-ui组件库,配合Axios进行前后端数据交互。
8 |
9 | # 功能模块概述
10 |
11 | 1. 应急物资,应急物资分类管理模块:
12 | 该模块主要是对应急物资以及其分类进行统一的管理,包含对应急物资的新增,支出,信息更新,删除。并提供了多种筛选方式可以边快速的获取到应急物资的当前情况。针对物资分类也提供了类似的功能。
13 | 2. 应急事件管理模块:
14 | 该模块作为应急物资调度的先导而存在,可以通过该模块进行应急事件的建立,维护,并可以按照实际生活中的处理进度,更新某个应急事件的处理状态。进行统一的跟进,同时可以在该界面获取到历史的应急事件以及其处理状态,通过多种方式筛选出指定的数据,然后提供了针对某一个应急事件的物资申请发起的功能,可以为这个事件申请物资。
15 | 3. 审批模块:
16 | 该模块主要是配合应急事件管理模块,对来自该模块下建立的申请进行审批,结合实际的情况进行处理,选择通过审批或者驳回。只有经过审批之后,相关的流程才可以继续流转下去。
17 | 4. 应急物资运输模块:
18 | 通过该模块可以对已经通过审批的申请建立物资运输单,进而对申请的物资进行运输工作,并且可以在这个过程中对其进行物资的流转等操作,应急事件管理人员也可以在该模块下选择结束流转一个运输单,表示已经收到了物资。
19 | 5. 系统模块:
20 | 通过该模块对用户的信息进行管理,进行登录验证,用户权限判断等操作,并且按照用户的身份为其生成菜单。并记录其操作日志。
21 |
22 | # 使用该项目
23 | 1. 使用yarn安装依赖。
24 | 2. 在/src/axios/request.js中配置apiBaseURL属性,指定后端项目运行的地址。
25 | 3. 启动项目,访问http://localhost:8080进入系统。
26 |
27 | # TIPS:
28 | - 糟心的毕设体验之旅,第一份莫名其妙的大改。无奈推到重来,便有了当前重写的第二份,时间太太太仓促,很多地方只求能用即可,
29 | 因而部分功能需要继续改动,较为明显的就是:目前项目已经有了权限控制,但是后端是完全没有生效的,所有的人员均可以访问接口,
30 | 权限的实现是在前端项目进行控制。如若要进行处理,请fork并合理改造改项目。
31 | - 系统启动成功之后,登录信息参见后端项目的t_user表,密码直接存储明文,可以直接使用。
32 |
33 | # 界面
34 | 
35 | 
36 | 
37 | 
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/entity/EventPO.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import com.fasterxml.jackson.annotation.JsonFormat;
5 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
6 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
7 | import io.swagger.annotations.ApiModel;
8 | import io.swagger.annotations.ApiModelProperty;
9 | import lombok.Data;
10 | import lombok.EqualsAndHashCode;
11 | import lombok.experimental.Accessors;
12 |
13 | import java.io.Serializable;
14 | import java.time.LocalDateTime;
15 |
16 | /**
17 | * @author xugongkai
18 | * @since 2020-04-21
19 | */
20 | @Data
21 | @EqualsAndHashCode(callSuper = false)
22 | @Accessors(chain = true)
23 | @TableName("t_event")
24 | @ApiModel(value = "EventPO对象", description = "")
25 | public class EventPO implements Serializable {
26 |
27 | private static final long serialVersionUID = 1L;
28 |
29 | @ApiModelProperty(value = "主键")
30 | @JsonSerialize(using = ToStringSerializer.class)
31 | private Long id;
32 |
33 | @ApiModelProperty(value = "事件名称")
34 | private String title;
35 |
36 | @ApiModelProperty(value = "地点")
37 | private String address;
38 |
39 | @ApiModelProperty(value = "坐标")
40 | private String loc;
41 |
42 | @ApiModelProperty(value = "创建时间")
43 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
44 | private LocalDateTime createTime;
45 |
46 | @ApiModelProperty(value = "创建人ID")
47 | private Long createUserId;
48 |
49 | @ApiModelProperty(value = "等级")
50 | private String level;
51 |
52 | @ApiModelProperty(value = "受灾图片:图片地址A#图片地址B#图片地址C")
53 | private String picture;
54 |
55 | @ApiModelProperty(value = "详细说明")
56 | private String detail;
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/utils/BeanCopyUtils.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.utils;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.rits.cloning.Cloner;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * javaBean拷贝工具
11 | * 可深度拷贝对象以及对象集合
12 | */
13 | public class BeanCopyUtils {
14 |
15 | private static final Cloner CLONER = new Cloner();
16 |
17 | /**
18 | * 复制对象(深度拷贝)
19 | * @param object
20 | * @param
21 | * @return
22 | */
23 | public static T clone(final T object){
24 | if (object == null) {
25 | return null;
26 | }
27 | return CLONER.deepClone(object);
28 | }
29 |
30 | /**
31 | * 复制集合(深度拷贝)
32 | * @param object
33 | * @param
34 | * @return
35 | */
36 | public static List cloneList(final List object){
37 | if (object == null) {
38 | return null;
39 | }
40 | return CLONER.deepClone(object);
41 | }
42 |
43 | /**
44 | * 复制对象到指定类(深度拷贝)
45 | * @param object
46 | * @param destclas 指定类
47 | * @param
48 | * @return
49 | */
50 | public static T clone(final Object object, Class destclas){
51 | if (object == null) {
52 | return null;
53 | }
54 | String json = JSON.toJSONString(object);
55 | return JSON.parseObject(json, destclas);
56 | }
57 |
58 | /**
59 | * 复制集合到指定类(深度拷贝)
60 | * @param object
61 | * @param destclas 指定类
62 | * @param
63 | * @return
64 | */
65 | public static List cloneList(List> object, Class destclas) {
66 | if (object == null) {
67 | return new ArrayList();
68 | }
69 | String json = JSON.toJSONString(object);
70 | return JSON.parseArray(json, destclas);
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/websocket/WebSocketServer.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.websocket;
2 |
3 | import lombok.extern.slf4j.Slf4j;
4 | import org.springframework.stereotype.Component;
5 |
6 | import javax.websocket.*;
7 | import javax.websocket.server.ServerEndpoint;
8 | import java.util.Map;
9 | import java.util.concurrent.ConcurrentHashMap;
10 |
11 | /**
12 | * @author: 开
13 | * @date: 2020-03-27 11:48:33
14 | * @describe: Websocket 服务端示例
15 | */
16 | @Component
17 | @Slf4j
18 | @ServerEndpoint("/ws")
19 | public class WebSocketServer {
20 |
21 | /**
22 | * 存放所有在线的客户端
23 | */
24 | private static Map clients = new ConcurrentHashMap<>();
25 |
26 | @OnOpen
27 | public void onOpen(Session session) {
28 | log.info("有新的客户端连接了: {}", session.getId());
29 | clients.put(session.getId(), session);
30 | }
31 |
32 | /**
33 | * 客户端关闭
34 | * @param session session
35 | */
36 | @OnClose
37 | public void onClose(Session session) {
38 | log.info("有用户断开了, id为:{}", session.getId());
39 | clients.remove(session.getId());
40 | }
41 |
42 | /**
43 | * 发生错误
44 | * @param throwable e
45 | */
46 | @OnError
47 | public void onError(Throwable throwable) {
48 | throwable.printStackTrace();
49 | }
50 |
51 | /**
52 | * 收到客户端发来消息
53 | * @param message 消息对象
54 | */
55 | @OnMessage
56 | public void onMessage(String message, Session session) {
57 | log.info("服务端收到客户端发来的消息: {}, id = {}", message, session.getId());
58 | sendAll(message);
59 | }
60 |
61 | /**
62 | * 群发消息
63 | * @param message 消息内容
64 | */
65 | private void sendAll(String message) {
66 | for (Map.Entry sessionEntry : clients.entrySet()) {
67 | sessionEntry.getValue().getAsyncRemote().sendText(message);
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/entity/MaterialCategoryPO.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import com.baomidou.mybatisplus.extension.activerecord.Model;
5 | import com.fasterxml.jackson.annotation.JsonFormat;
6 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
7 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
8 | import io.swagger.annotations.ApiModel;
9 | import io.swagger.annotations.ApiModelProperty;
10 | import lombok.Data;
11 | import lombok.EqualsAndHashCode;
12 | import lombok.experimental.Accessors;
13 |
14 | import java.io.Serializable;
15 | import java.time.LocalDateTime;
16 |
17 | /**
18 | *
19 | *
20 | *
21 | *
22 | * @author xugongkai
23 | * @since 2020-04-19
24 | */
25 | @Data
26 | @EqualsAndHashCode(callSuper = false)
27 | @Accessors(chain = true)
28 | @TableName("t_material_category")
29 | @ApiModel(value="MaterialCategoryPO对象", description="")
30 | public class MaterialCategoryPO extends Model {
31 |
32 | private static final long serialVersionUID = 1L;
33 |
34 | @ApiModelProperty(value = "主键")
35 | @JsonSerialize(using = ToStringSerializer.class)
36 | private Long id;
37 |
38 | @ApiModelProperty(value = "物资分类编码")
39 | private String categoryCode;
40 |
41 | @ApiModelProperty(value = "物资分类名称")
42 | private String categoryName;
43 |
44 | @ApiModelProperty(value = "调配策略")
45 | private Boolean enable;
46 |
47 | @ApiModelProperty(value = "创建日期")
48 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
49 | private LocalDateTime createTime;
50 |
51 | @ApiModelProperty(value = "创建人ID")
52 | @JsonSerialize(using = ToStringSerializer.class)
53 | private Long createUserId;
54 |
55 |
56 | @Override
57 | protected Serializable pkVal() {
58 | return this.id;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/config/SwaggerConfig.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.config;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 | import org.springframework.stereotype.Component;
8 | import springfox.documentation.builders.ApiInfoBuilder;
9 | import springfox.documentation.builders.PathSelectors;
10 | import springfox.documentation.builders.RequestHandlerSelectors;
11 | import springfox.documentation.service.ApiInfo;
12 | import springfox.documentation.service.Contact;
13 | import springfox.documentation.spi.DocumentationType;
14 | import springfox.documentation.spring.web.plugins.Docket;
15 | import springfox.documentation.swagger2.annotations.EnableSwagger2;
16 |
17 | /**
18 | * @author: xugongkai
19 | * @data: 2019-12-11 17:09:23
20 | * @describe: 文档配置
21 | **/
22 | @Configuration
23 | @EnableSwagger2
24 | public class SwaggerConfig {
25 |
26 | @Value("${server.servlet.application-display-name}")
27 | private String applicationName;
28 |
29 | @Bean
30 | public Docket createRestApi() {
31 | return new Docket(DocumentationType.SWAGGER_2)
32 | .apiInfo(apiInfo())
33 | .select()
34 | .apis(RequestHandlerSelectors.basePackage("com.bestbigkk.web"))
35 | .paths(PathSelectors.any())
36 | .build();
37 | }
38 |
39 | private ApiInfo apiInfo() {
40 | final ApiInfo build = new ApiInfoBuilder()
41 | .title(applicationName)
42 | .description("应急物资保障系统")
43 | .termsOfServiceUrl("http://localhost:21584/")
44 | .contact(new Contact("xugongkai", "bestbigkk.com", "xugongkai@banggood.com"))
45 | .version("1.0-SNAPSHOT")
46 | .build();
47 | return build;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/entity/OperationLogPO.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import com.baomidou.mybatisplus.extension.activerecord.Model;
5 | import com.fasterxml.jackson.annotation.JsonFormat;
6 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
7 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
8 | import io.swagger.annotations.ApiModel;
9 | import io.swagger.annotations.ApiModelProperty;
10 | import lombok.*;
11 | import lombok.experimental.Accessors;
12 |
13 | import java.io.Serializable;
14 | import java.time.LocalDateTime;
15 |
16 | /**
17 | *
18 | * 操作日志表
19 | *
20 | *
21 | * @author xugongkai
22 | * @since 2020-03-24
23 | */
24 | @Builder
25 | @NoArgsConstructor
26 | @AllArgsConstructor
27 | @Data
28 | @EqualsAndHashCode(callSuper = false)
29 | @Accessors(chain = true)
30 | @TableName("t_operation_log")
31 | @ApiModel(value="OperationLogPO对象", description="操作日志表")
32 | public class OperationLogPO extends Model {
33 |
34 | private static final long serialVersionUID=1L;
35 |
36 | @ApiModelProperty(value = "主键")
37 | @JsonSerialize(using = ToStringSerializer.class)
38 | private Long id;
39 |
40 | @ApiModelProperty(value = "请求者IP")
41 | private String ip;
42 |
43 | @ApiModelProperty(value = "模块名称")
44 | private String modelName;
45 |
46 | @ApiModelProperty(value = "创建时间")
47 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
48 | private LocalDateTime createTime;
49 |
50 | @ApiModelProperty(value = "日志行为简述")
51 | private String logDescription;
52 |
53 | @ApiModelProperty(value = "携带参数")
54 | private String actionArgs;
55 |
56 | @ApiModelProperty(value = "日志产生地方【ClassName:methodName】")
57 | private String logLocation;
58 |
59 | @ApiModelProperty(value = "异常简述")
60 | private String errorMsg;
61 |
62 | @ApiModelProperty(value = "堆栈信息")
63 | private String stackInfo;
64 |
65 | @Override
66 | protected Serializable pkVal() {
67 | return this.id;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-service/src/main/java/com/bestbigkk/service/qiniu/impl/UploadServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.service.qiniu.impl;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.bestbigkk.common.config.oss.qiniu.QiniuConfig;
5 | import com.bestbigkk.service.qiniu.UploadService;
6 | import com.qiniu.common.QiniuException;
7 | import com.qiniu.common.Zone;
8 | import com.qiniu.http.Response;
9 | import com.qiniu.storage.Configuration;
10 | import com.qiniu.storage.UploadManager;
11 | import com.qiniu.storage.model.DefaultPutRet;
12 | import com.qiniu.util.Auth;
13 | import lombok.extern.slf4j.Slf4j;
14 | import org.springframework.beans.factory.annotation.Autowired;
15 | import org.springframework.stereotype.Service;
16 |
17 | import java.io.InputStream;
18 |
19 | /**
20 | * @author: 开
21 | * @date: 2020-04-25 12:24:23
22 | * @describe: 七牛云上传实现
23 | */
24 | @Slf4j
25 | @Service
26 | public class UploadServiceImpl implements UploadService {
27 |
28 | @Autowired
29 | private QiniuConfig qiniuProperties;
30 |
31 | @Override
32 | public String uploadFile(InputStream inputStream, String fileName) throws QiniuException {
33 | //构造一个带指定Zone对象的配置类
34 | Configuration cfg = new Configuration(Zone.zone0());
35 | UploadManager uploadManager = new UploadManager(cfg);
36 | //默认不指定key的情况下,以文件内容的hash值作为文件名
37 | Auth auth = Auth.create(qiniuProperties.getAccessKey(), qiniuProperties.getSecretKey());
38 | String upToken = auth.uploadToken(qiniuProperties.getBucket());
39 | try {
40 | Response response = uploadManager.put(inputStream, fileName, upToken, null, null);
41 | //解析上传成功的结果
42 | DefaultPutRet putRet = JSON.parseObject(response.bodyString(), DefaultPutRet.class);
43 | String return_path = qiniuProperties.getPath()+"/"+putRet.key;
44 | log.info("七牛云上传地址:{}", return_path);
45 | return return_path;
46 | } catch (QiniuException ex) {
47 | log.error("上传错误", ex);
48 | }
49 | return "";
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/bbk-mss-vue/src/components/BaiDuMapTrace.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
62 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/entity/UserPO.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import com.baomidou.mybatisplus.extension.activerecord.Model;
5 | import com.fasterxml.jackson.annotation.JsonFormat;
6 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
7 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
8 | import io.swagger.annotations.ApiModel;
9 | import io.swagger.annotations.ApiModelProperty;
10 | import lombok.Data;
11 | import lombok.EqualsAndHashCode;
12 | import lombok.experimental.Accessors;
13 |
14 | import java.io.Serializable;
15 | import java.time.LocalDateTime;
16 |
17 | /**
18 | *
19 | *
20 | *
21 | *
22 | * @author xugongkai
23 | * @since 2020-04-19
24 | */
25 | @Data
26 | @EqualsAndHashCode(callSuper = false)
27 | @Accessors(chain = true)
28 | @TableName("t_user")
29 | @ApiModel(value="UserPO对象", description="")
30 | public class UserPO extends Model {
31 |
32 | private static final long serialVersionUID = 1L;
33 |
34 | @ApiModelProperty(value = "id")
35 | @JsonSerialize(using = ToStringSerializer.class)
36 | private Long id;
37 |
38 | @ApiModelProperty(value = "账户")
39 | private String account;
40 |
41 | @ApiModelProperty(value = "密码")
42 | private String password;
43 |
44 | @ApiModelProperty(value = "盐值")
45 | private String salt;
46 |
47 | @ApiModelProperty(value = "昵称")
48 | private String nickName;
49 |
50 | @ApiModelProperty(value = "性别")
51 | private String sex;
52 |
53 | @ApiModelProperty(value = "头像地址")
54 | private String picture;
55 |
56 | @ApiModelProperty(value = "地址")
57 | private String address;
58 |
59 | @ApiModelProperty(value = "身份编码")
60 | private Integer identityCode;
61 |
62 | @ApiModelProperty(value = "身份名称")
63 | private String identityName;
64 |
65 | @ApiModelProperty(value = "创建时间")
66 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
67 | private LocalDateTime createTime;
68 |
69 | @ApiModelProperty(value = "账户是否启用")
70 | private Integer enable;
71 |
72 |
73 | @Override
74 | protected Serializable pkVal() {
75 | return this.id;
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-common/src/main/java/com/bestbigkk/common/utils/QueryWrapperUtils.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.common.utils;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableField;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6 | import org.springframework.stereotype.Component;
7 |
8 | import java.lang.reflect.Field;
9 | import java.util.Arrays;
10 | import java.util.HashSet;
11 |
12 | /**
13 | * @author: 开
14 | * @date: 2020-04-19 19:16:29
15 | * @describe: mybatis-plus query wrapper 条件构造器工具
16 | */
17 |
18 | @Component
19 | public class QueryWrapperUtils {
20 |
21 | /**
22 | * 传递一个对象,将该对象中所有非空(null)的属性构建为一个querywrapper查询器的条件。
23 | * @param t 对象
24 | * @param ignorePropertiesName 忽略的属性,这些属性不会进入构建为条件
25 | * @param 构件好的条件查询器。
26 | */
27 | public QueryWrapper buildNotNullEqualsWrapper(T t, String...ignorePropertiesName){
28 | QueryWrapper wrapper = new QueryWrapper<>();
29 | HashSet ignore = new HashSet<>(Arrays.asList(ignorePropertiesName));
30 | for (Field field : t.getClass().getDeclaredFields()) {
31 | field.setAccessible(true);
32 | final String filedName = field.getName();
33 | if ("serialVersionUID".equals(filedName) || ignore.contains(filedName)) {
34 | continue;
35 | }
36 | try {
37 | if(field.get(t) == null){
38 | continue;
39 | }
40 | TableId tableId = field.getAnnotation(TableId.class);
41 | if (tableId != null){
42 | wrapper.eq(tableId.value(),field.get(t));
43 | continue;
44 | }
45 | TableField tableField = field.getAnnotation(TableField.class);
46 | if(tableField != null && tableField.exist()){
47 | wrapper.eq(tableField.value(),field.get(t));
48 | continue;
49 | }
50 | wrapper.eq(filedName.replaceAll("[A-Z]", "_$0").toLowerCase(),field.get(t));
51 | } catch (IllegalAccessException e) {
52 | e.printStackTrace();
53 | }
54 | }
55 | return wrapper;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-persistence/src/main/java/com/bestbigkk/persistence/entity/MaterialPO.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.persistence.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.TableName;
4 | import com.baomidou.mybatisplus.extension.activerecord.Model;
5 | import com.fasterxml.jackson.annotation.JsonFormat;
6 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
7 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
8 | import io.swagger.annotations.ApiModel;
9 | import io.swagger.annotations.ApiModelProperty;
10 | import lombok.Data;
11 | import lombok.EqualsAndHashCode;
12 | import lombok.experimental.Accessors;
13 |
14 | import java.io.Serializable;
15 | import java.time.LocalDateTime;
16 |
17 | /**
18 | *
19 | *
20 | *
21 | *
22 | * @author xugongkai
23 | * @since 2020-04-19
24 | */
25 | @Data
26 | @EqualsAndHashCode(callSuper = false)
27 | @Accessors(chain = true)
28 | @TableName("t_material")
29 | @ApiModel(value="MaterialPO对象", description="")
30 | public class MaterialPO extends Model {
31 |
32 | private static final long serialVersionUID = 1L;
33 |
34 | @ApiModelProperty(value = "主键")
35 | @JsonSerialize(using = ToStringSerializer.class)
36 | private Long id;
37 |
38 | @ApiModelProperty(value = "物资批次")
39 | private String materialBatchNo;
40 |
41 | @ApiModelProperty(value = "物资名称")
42 | private String materialName;
43 |
44 | @ApiModelProperty(value = "分类名称")
45 | private String materialCategoryCode;
46 |
47 | @ApiModelProperty(value = "库存数量")
48 | private Integer materialNum;
49 |
50 | @ApiModelProperty(value = "购进来源")
51 | private String materialFrom;
52 |
53 | @ApiModelProperty(value = "被购方联系人")
54 | private String materialContactName;
55 |
56 | @ApiModelProperty(value = "被购方联系方式")
57 | private String materialContactNo;
58 |
59 | @ApiModelProperty(value = "购入合同编号")
60 | private String materialContractNo;
61 |
62 | @ApiModelProperty(value = "调配策略")
63 | private Boolean materialEnable;
64 |
65 | @ApiModelProperty(value = "创建日期")
66 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
67 | private LocalDateTime createTime;
68 |
69 |
70 | @Override
71 | protected Serializable pkVal() {
72 | return this.id;
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/aspect/impl/AccessLimitAspect.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.aspect.impl;
2 |
3 | import com.bestbigkk.common.utils.RequestContextHolderUtils;
4 | import com.bestbigkk.common.aspect.AbstractAspect;
5 | import com.bestbigkk.common.exception.BusinessException;
6 | import com.bestbigkk.common.web.ResultCode;
7 | import com.bestbigkk.web.validator.AccessLimit;
8 | import com.google.common.collect.Maps;
9 | import com.google.common.util.concurrent.RateLimiter;
10 | import lombok.extern.slf4j.Slf4j;
11 | import org.aspectj.lang.JoinPoint;
12 | import org.springframework.stereotype.Component;
13 |
14 | import javax.servlet.http.HttpServletRequest;
15 | import java.lang.reflect.Method;
16 | import java.util.Map;
17 |
18 | /**
19 | * @author: 开
20 | * @date: 2020-03-24 15:04:07
21 | * @describe: 限流切面, 借助Guava中的令牌桶,进行实现。限制各个url的访问速率
22 | */
23 | @Slf4j
24 | @Component
25 | public class AccessLimitAspect extends AbstractAspect {
26 |
27 | /**使用url做为key,存放令牌桶 防止每次重新创建令牌桶*/
28 | private static final Map limitMap = Maps.newConcurrentMap();
29 |
30 | @Override
31 | public Object doHandlerAspect(JoinPoint joinPoint, Method method, Throwable throwable)throws Throwable {
32 | execute(joinPoint,method, throwable);
33 | return null;
34 | }
35 |
36 | @Override
37 | public Object execute(JoinPoint pjp, Method method, Throwable throwable) {
38 |
39 | log.info("尝试从令牌桶获取令牌");
40 |
41 | AccessLimit lxRateLimit = method.getAnnotation(AccessLimit.class);
42 | final HttpServletRequest request = RequestContextHolderUtils.getRequest();
43 |
44 | // 或者url(存在map集合的key)
45 | String url = request.getRequestURI();
46 | RateLimiter rateLimiter;
47 | if (!limitMap.containsKey(url)) {
48 | // 为这个Url创建令牌桶
49 | rateLimiter = RateLimiter.create(lxRateLimit.perSecond());
50 | limitMap.put(url, rateLimiter);
51 | log.info("为请求{},创建令牌桶,容量{}",url,lxRateLimit.perSecond());
52 | }
53 | rateLimiter = limitMap.get(url);
54 |
55 | //获取令牌
56 | if (!rateLimiter.tryAcquire(lxRateLimit.timeOut(), lxRateLimit.timeOutUnit())) {
57 | throw new BusinessException(ResultCode.SERVER_BUSY, "");
58 | }
59 | return null;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/bbk-mss-java/bbk-mss-web/src/main/java/com/bestbigkk/web/aspect/impl/LogRecordPersistence.java:
--------------------------------------------------------------------------------
1 | package com.bestbigkk.web.aspect.impl;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 | import com.bestbigkk.common.utils.RedisUtils;
5 | import com.bestbigkk.persistence.dao.OperationLogDao;
6 | import com.bestbigkk.persistence.entity.OperationLogPO;
7 | import lombok.extern.slf4j.Slf4j;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.beans.factory.annotation.Value;
10 | import org.springframework.scheduling.annotation.Async;
11 | import org.springframework.stereotype.Component;
12 |
13 | import javax.annotation.PostConstruct;
14 | import java.util.LinkedList;
15 | import java.util.List;
16 |
17 | /**
18 | * @author: 开
19 | * @date: 2020-03-24 21:40:34
20 | * @describe: 日志对象持久化异步类,异步操作需要独立出来一个类才可以。
21 | */
22 | @Component
23 | @Slf4j
24 | public class LogRecordPersistence{
25 |
26 | /**缓存在Redis中的待持久化日志对象数量。*/
27 | @Value("${bbk.log.cache:200L}")
28 | public Long CACHE_LENGTH;
29 | public final String REDIS_KEY = "operation:log:list:cache";
30 |
31 | private final RedisUtils redisUtils;
32 | private final OperationLogDao operationLogDao;
33 |
34 | public LogRecordPersistence(RedisUtils redisUtils, OperationLogDao operationLogDao) {
35 | this.redisUtils = redisUtils;
36 | this.operationLogDao = operationLogDao;
37 | }
38 |
39 | @PostConstruct
40 | void init() {
41 | log.info("方法执行日志缓存数量:{}", CACHE_LENGTH);
42 | }
43 |
44 | boolean add(OperationLogPO operationLogPO) {
45 | final long size = redisUtils.lGetListSize(REDIS_KEY);
46 | if (size >= CACHE_LENGTH) {
47 | return false;
48 | }
49 | return redisUtils.lSet(REDIS_KEY, JSONObject.toJSONString(operationLogPO));
50 | }
51 |
52 | @Async
53 | public void persistence(OperationLogPO operationLogPO) {
54 | final List