├── vuehr ├── static │ └── .gitkeep ├── favicon.ico ├── build │ ├── logo.png │ ├── vue-loader.conf.js │ ├── build.js │ ├── check-versions.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ ├── utils.js │ └── webpack.prod.conf.js ├── config │ ├── prod.env.js │ ├── dev.env.js │ └── index.js ├── src │ ├── components │ │ ├── emp │ │ │ └── EmpAdv.vue │ │ ├── system │ │ │ ├── basic │ │ │ │ ├── JobTitleMana.vue │ │ │ │ └── MenuRole.vue │ │ │ └── SysBasic.vue │ │ ├── chat │ │ │ ├── Chat.vue │ │ │ └── Notification.vue │ │ ├── Login.vue │ │ └── personnel │ │ │ └── PerEc.vue │ ├── App.vue │ ├── utils │ │ ├── filter_utils.js │ │ ├── utils.js │ │ └── api.js │ ├── main.js │ ├── router │ │ └── index.js │ └── store │ │ └── index.js ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── .babelrc ├── index.html ├── README.md └── package.json ├── hrserver ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── src │ └── main │ │ ├── resources │ │ ├── application.properties │ │ ├── static │ │ │ ├── static │ │ │ │ ├── fonts │ │ │ │ │ ├── element-icons.6f0a763.ttf │ │ │ │ │ ├── fontawesome-webfont.674f50d.eot │ │ │ │ │ ├── fontawesome-webfont.af7ae50.woff2 │ │ │ │ │ ├── fontawesome-webfont.b06871f.ttf │ │ │ │ │ └── fontawesome-webfont.fee66e7.woff │ │ │ │ └── js │ │ │ │ │ └── manifest.a15c571fcebaca4d03a9.js │ │ │ └── index.html │ │ ├── mybatis-config.xml │ │ └── templates │ │ │ └── email.html │ │ ├── java │ │ └── org │ │ │ └── sang │ │ │ ├── mapper │ │ │ ├── SystemMapper.java │ │ │ ├── StatisticsMapper.java │ │ │ ├── MenuRoleMapper.java │ │ │ ├── MenuMapper.java │ │ │ ├── RoleMapper.java │ │ │ ├── DepartmentMapper.java │ │ │ ├── PositionMapper.java │ │ │ ├── JobLevelMapper.java │ │ │ ├── MenuRoleMapper.xml │ │ │ ├── RoleMapper.xml │ │ │ ├── SysMsgMapper.java │ │ │ ├── StatisticsMapper.xml │ │ │ ├── HrMapper.java │ │ │ ├── SalaryMapper.java │ │ │ ├── PositionMapper.xml │ │ │ ├── JobLevelMapper.xml │ │ │ ├── PersonnelMapper.java │ │ │ ├── DepartmentMapper.xml │ │ │ ├── EmpMapper.java │ │ │ ├── SysMsgMapper.xml │ │ │ ├── MenuMapper.xml │ │ │ ├── SalaryMapper.xml │ │ │ └── HrMapper.xml │ │ │ ├── common │ │ │ ├── HrUtils.java │ │ │ ├── DateConverter.java │ │ │ └── EmailRunnable.java │ │ │ ├── HrserverApplication.java │ │ │ ├── service │ │ │ ├── SystemService.java │ │ │ ├── MenuRoleService.java │ │ │ ├── StatisticsService.java │ │ │ ├── RoleService.java │ │ │ ├── MenuService.java │ │ │ ├── PositionService.java │ │ │ ├── JobLevelService.java │ │ │ ├── DepartmentService.java │ │ │ ├── SysMsgService.java │ │ │ ├── SalaryService.java │ │ │ ├── HrService.java │ │ │ ├── PersonnelService.java │ │ │ └── EmpService.java │ │ │ ├── controller │ │ │ ├── EmployeeController.java │ │ │ ├── PersonnelController.java │ │ │ ├── ConfigController.java │ │ │ ├── RegLoginController.java │ │ │ ├── WsController.java │ │ │ ├── personnel │ │ │ │ ├── EmpEcController.java │ │ │ │ ├── EmpSalaryController.java │ │ │ │ ├── EmpRemoveController.java │ │ │ │ └── EmpTrainController.java │ │ │ ├── statistics │ │ │ │ ├── InfoStatisticsController.java │ │ │ │ └── PerStatisticsController.java │ │ │ ├── salary │ │ │ │ ├── SalaryController.java │ │ │ │ ├── SalaryEmpController.java │ │ │ │ ├── SalaryTableController.java │ │ │ │ └── SalarySearchController.java │ │ │ ├── ChatController.java │ │ │ ├── system │ │ │ │ └── SystemHrController.java │ │ │ └── emp │ │ │ │ └── EmpBasicController.java │ │ │ ├── bean │ │ │ ├── MenuMeta.java │ │ │ ├── ChatResp.java │ │ │ ├── Role.java │ │ │ ├── MsgContent.java │ │ │ ├── Nation.java │ │ │ ├── Statistics.java │ │ │ ├── PoliticsStatus.java │ │ │ ├── InfoStatistics.java │ │ │ ├── SysMsg.java │ │ │ ├── EmpEc.java │ │ │ ├── Position.java │ │ │ ├── SalSearch.java │ │ │ ├── SalaryMan.java │ │ │ ├── RespBean.java │ │ │ ├── EmpTrain.java │ │ │ ├── JobLevel.java │ │ │ ├── EmpMove.java │ │ │ ├── AdjustSalary.java │ │ │ ├── Menu.java │ │ │ ├── Department.java │ │ │ ├── Salary.java │ │ │ └── Hr.java │ │ │ ├── config │ │ │ ├── WebMvcConfig.java │ │ │ ├── WebSocketConfig.java │ │ │ ├── AuthenticationAccessDeniedHandler.java │ │ │ ├── CustomMetadataSource.java │ │ │ └── UrlAccessDecisionManager.java │ │ │ └── exception │ │ │ └── CustomExceptionResolver.java │ │ └── test │ │ └── org │ │ └── sang │ │ └── PersonnelServiceTest.java ├── .gitignore ├── pom.xml └── mvnw.cmd └── README.md /vuehr/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vuehr/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/vuehr/favicon.ico -------------------------------------------------------------------------------- /vuehr/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/vuehr/build/logo.png -------------------------------------------------------------------------------- /vuehr/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /vuehr/src/components/emp/EmpAdv.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /hrserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/hrserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /hrserver/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/hrserver/src/main/resources/application.properties -------------------------------------------------------------------------------- /hrserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip 2 | -------------------------------------------------------------------------------- /vuehr/src/components/system/basic/JobTitleMana.vue: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/SystemMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | /** 4 | * Created by sang on 2017/12/29. 5 | */ 6 | public interface SystemMapper { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /hrserver/src/main/resources/static/static/fonts/element-icons.6f0a763.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/hrserver/src/main/resources/static/static/fonts/element-icons.6f0a763.ttf -------------------------------------------------------------------------------- /vuehr/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /vuehr/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.674f50d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.674f50d.eot -------------------------------------------------------------------------------- /hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.af7ae50.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.af7ae50.woff2 -------------------------------------------------------------------------------- /hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.b06871f.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.b06871f.ttf -------------------------------------------------------------------------------- /hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.fee66e7.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1067649786/personnel/HEAD/hrserver/src/main/resources/static/static/fonts/fontawesome-webfont.fee66e7.woff -------------------------------------------------------------------------------- /vuehr/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | .vscode 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /vuehr/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserslist" field in package.json 6 | "postcss-import": {}, 7 | "autoprefixer": {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vuehr/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"] 12 | } 13 | -------------------------------------------------------------------------------- /vuehr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 微人事 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /hrserver/src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/StatisticsMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.sang.bean.Department; 4 | 5 | import java.util.List; 6 | 7 | public interface StatisticsMapper { 8 | 9 | int getJoinCount(Long depId); 10 | 11 | int getAllPeoplebyDepId(Long depId); 12 | 13 | List getAllDeps(); 14 | } 15 | -------------------------------------------------------------------------------- /hrserver/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/MenuRoleMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | /** 6 | * Created by sang on 2018/1/2. 7 | */ 8 | public interface MenuRoleMapper { 9 | int deleteMenuByRid(@Param("rid") Long rid); 10 | 11 | int addMenu(@Param("rid") Long rid, @Param("mids") Long[] mids); 12 | } 13 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.sang.bean.Menu; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by sang on 2017/12/28. 9 | */ 10 | public interface MenuMapper { 11 | List getAllMenu(); 12 | 13 | List getMenusByHrId(Long hrId); 14 | 15 | List menuTree(); 16 | 17 | List getMenusByRid(Long rid); 18 | } 19 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/common/HrUtils.java: -------------------------------------------------------------------------------- 1 | package org.sang.common; 2 | 3 | import org.sang.bean.Hr; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | 6 | /** 7 | * Created by sang on 2017/12/30. 8 | */ 9 | public class HrUtils { 10 | public static Hr getCurrentHr() { 11 | return (Hr) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.Role; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by sang on 2018/1/1. 10 | */ 11 | public interface RoleMapper { 12 | List roles(); 13 | 14 | int addNewRole(@Param("role") String role, @Param("roleZh") String roleZh); 15 | 16 | int deleteRoleById(Long rid); 17 | } 18 | -------------------------------------------------------------------------------- /vuehr/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 23 | -------------------------------------------------------------------------------- /hrserver/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 微人事
-------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.Department; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by sang on 2018/1/7. 10 | */ 11 | public interface DepartmentMapper { 12 | void addDep(@Param("dep") Department department); 13 | 14 | void deleteDep(@Param("dep") Department department); 15 | 16 | List getDepByPid(Long pid); 17 | 18 | List getAllDeps(); 19 | } 20 | -------------------------------------------------------------------------------- /vuehr/README.md: -------------------------------------------------------------------------------- 1 | # vuehr 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | 21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 22 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/HrserverApplication.java: -------------------------------------------------------------------------------- 1 | package org.sang; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cache.annotation.EnableCaching; 7 | 8 | @SpringBootApplication 9 | @MapperScan("org.sang.mapper") 10 | @EnableCaching 11 | public class HrserverApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(HrserverApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/PositionMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.Position; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by sang on 2018/1/10. 10 | */ 11 | public interface PositionMapper { 12 | 13 | int addPos(@Param("pos") Position pos); 14 | 15 | Position getPosByName(String name); 16 | 17 | List getAllPos(); 18 | 19 | int deletePosById(@Param("pids") String[] pids); 20 | 21 | int updatePosById(@Param("pos") Position position); 22 | } 23 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/SystemService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.mapper.SystemMapper; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | /** 10 | * Created by sang on 2017/12/29. 11 | */ 12 | @Service 13 | @Transactional 14 | public class SystemService { 15 | @Autowired 16 | SystemMapper systemMapper; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/EmployeeController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * Created by sang on 2017/12/29. 8 | */ 9 | @RestController 10 | @RequestMapping("/employee") 11 | public class EmployeeController { 12 | @RequestMapping("/basic") 13 | public String basic() { 14 | return "basic"; 15 | } 16 | @RequestMapping("/") 17 | public String hello() { 18 | return "Hello"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/PersonnelController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * Created by sang on 2017/12/29. 8 | */ 9 | @RestController 10 | @RequestMapping("/personnel") 11 | public class PersonnelController { 12 | @RequestMapping("/") 13 | public String hello() { 14 | return "hello"; 15 | } 16 | @RequestMapping("/emp/hello") 17 | public String helloEmp() { 18 | return "hello emp"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/JobLevelMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.JobLevel; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by sang on 2018/1/11. 10 | */ 11 | public interface JobLevelMapper { 12 | JobLevel getJobLevelByName(String name); 13 | 14 | int addJobLevel(@Param("jobLevel") JobLevel jobLevel); 15 | 16 | List getAllJobLevels(); 17 | 18 | int deleteJobLevelById(@Param("ids") String[] ids); 19 | 20 | int updateJobLevel(@Param("jobLevel") JobLevel jobLevel); 21 | } 22 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/MenuRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | DELETE FROM menu_role WHERE rid=#{rid} 8 | 9 | 10 | INSERT INTO menu_role(mid,rid) VALUES 11 | 12 | (#{mid},#{rid}) 13 | 14 | 15 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/RoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | INSERT INTO role set name=#{role},nameZh=#{roleZh} 11 | 12 | 13 | DELETE FROM role WHERE id=#{rid} 14 | 15 | -------------------------------------------------------------------------------- /vuehr/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/SysMsgMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.Hr; 5 | import org.sang.bean.MsgContent; 6 | import org.sang.bean.SysMsg; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by sang on 2018/2/2. 12 | */ 13 | public interface SysMsgMapper { 14 | 15 | int sendMsg(MsgContent msg); 16 | 17 | int addMsg2AllHr(@Param("hrs") List
hrs, @Param("mid") Long mid); 18 | 19 | List getSysMsg(@Param("start") int start, @Param("size") Integer size,@Param("hrid") Long hrid); 20 | 21 | int markRead(@Param("flag") Long flag, @Param("hrid") Long hrid); 22 | } 23 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/MenuMeta.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by sang on 2017/12/30. 7 | */ 8 | public class MenuMeta implements Serializable { 9 | 10 | private boolean keepAlive; 11 | private boolean requireAuth; 12 | 13 | public boolean isKeepAlive() { 14 | return keepAlive; 15 | } 16 | 17 | public void setKeepAlive(boolean keepAlive) { 18 | this.keepAlive = keepAlive; 19 | } 20 | 21 | public boolean isRequireAuth() { 22 | return requireAuth; 23 | } 24 | 25 | public void setRequireAuth(boolean requireAuth) { 26 | this.requireAuth = requireAuth; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/ChatResp.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | /** 4 | * Created by sang on 2018/1/29. 5 | */ 6 | public class ChatResp { 7 | private String msg; 8 | private String from; 9 | 10 | public ChatResp() { 11 | } 12 | 13 | public ChatResp(String msg, String from) { 14 | this.msg = msg; 15 | this.from = from; 16 | } 17 | 18 | public String getMsg() { 19 | return msg; 20 | } 21 | 22 | public void setMsg(String msg) { 23 | this.msg = msg; 24 | } 25 | 26 | public String getFrom() { 27 | return from; 28 | } 29 | 30 | public void setFrom(String from) { 31 | this.from = from; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Role.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by sang on 2017/12/28. 7 | */ 8 | public class Role implements Serializable { 9 | private Long id; 10 | private String name; 11 | private String nameZh; 12 | 13 | public String getNameZh() { 14 | return nameZh; 15 | } 16 | 17 | public void setNameZh(String nameZh) { 18 | this.nameZh = nameZh; 19 | } 20 | 21 | public Long getId() { 22 | return id; 23 | } 24 | 25 | public void setId(Long id) { 26 | this.id = id; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/StatisticsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 11 | 12 | 16 | 17 | 20 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/MenuRoleService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.mapper.MenuRoleMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | /** 10 | * Created by sang on 2018/1/2. 11 | */ 12 | @Service 13 | @Transactional 14 | public class MenuRoleService { 15 | @Autowired 16 | MenuRoleMapper menuRoleMapper; 17 | 18 | public int updateMenuRole(Long rid, Long[] mids) { 19 | menuRoleMapper.deleteMenuByRid(rid); 20 | if (mids.length == 0) { 21 | return 0; 22 | } 23 | return menuRoleMapper.addMenu(rid, mids); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/common/DateConverter.java: -------------------------------------------------------------------------------- 1 | package org.sang.common; 2 | 3 | import org.springframework.core.convert.converter.Converter; 4 | 5 | import java.text.ParseException; 6 | import java.text.SimpleDateFormat; 7 | import java.util.Date; 8 | 9 | /** 10 | * Created by sang on 2018/1/13. 11 | */ 12 | public class DateConverter implements Converter { 13 | private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); 14 | @Override 15 | public Date convert(String s) { 16 | if ("".equals(s) || s == null) { 17 | return null; 18 | } 19 | try { 20 | 21 | return simpleDateFormat.parse(s); 22 | } catch (ParseException e) { 23 | e.printStackTrace(); 24 | } 25 | return null; 26 | } 27 | } -------------------------------------------------------------------------------- /vuehr/src/components/chat/Chat.vue: -------------------------------------------------------------------------------- 1 | 9 | 29 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/HrMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.Hr; 5 | import org.sang.bean.Role; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by sang on 2017/12/28. 11 | */ 12 | public interface HrMapper { 13 | Hr loadUserByUsername(String username); 14 | 15 | List getRolesByHrId(Long id); 16 | 17 | int hrReg(@Param("username") String username, @Param("password") String password); 18 | 19 | List
getHrsByKeywords(@Param("keywords") String keywords); 20 | 21 | int updateHr(Hr hr); 22 | 23 | int deleteRoleByHrId(Long hrId); 24 | 25 | int addRolesForHr(@Param("hrId") Long hrId, @Param("rids") Long[] rids); 26 | 27 | Hr getHrById(Long hrId); 28 | 29 | int deleteHr(Long hrId); 30 | 31 | List
getAllHr(@Param("currentId") Long currentId); 32 | } 33 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/SalaryMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.Salary; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by sang on 2018/1/24. 11 | */ 12 | @Repository 13 | public interface SalaryMapper { 14 | int addSalary(@Param("salary") Salary salary); 15 | 16 | List getAllSalary(); 17 | 18 | int updateSalary(@Param("salary") Salary salary); 19 | 20 | int deleteSalary(@Param("ids") String[] ids); 21 | 22 | int deleteSalaryByEid(@Param("eid") Long eid); 23 | 24 | int addSidAndEid(@Param("sid") Integer sid, @Param("eid") Long eid); 25 | 26 | Salary getSalaryById(Long id); 27 | 28 | int getLeaveCount(Long eid); 29 | 30 | int getLateCount(Long eid); 31 | 32 | int getOvertime(Long eid); 33 | } 34 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/StatisticsService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.Department; 4 | import org.sang.mapper.StatisticsMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | @Transactional 13 | public class StatisticsService { 14 | 15 | @Autowired 16 | StatisticsMapper statisticsMapper; 17 | 18 | public int getJoinCount(Long depId){ 19 | return statisticsMapper.getJoinCount(depId); 20 | } 21 | 22 | public int getAllPeoplebyDepId(Long depId){ 23 | return statisticsMapper.getAllPeoplebyDepId(depId); 24 | } 25 | 26 | public List getAllDeps(){ 27 | return statisticsMapper.getAllDeps(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/ConfigController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller; 2 | 3 | import org.sang.bean.Hr; 4 | import org.sang.bean.Menu; 5 | import org.sang.common.HrUtils; 6 | import org.sang.service.MenuService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * 这是一个只要登录就能访问的Controller 15 | * 主要用来获取一些配置信息 16 | */ 17 | @RestController 18 | @RequestMapping("/config") 19 | public class ConfigController { 20 | @Autowired 21 | MenuService menuService; 22 | @RequestMapping("/sysmenu") 23 | public List sysmenu() { 24 | return menuService.getMenusByHrId(); 25 | } 26 | 27 | @RequestMapping("/hr") 28 | public Hr currentUser() { 29 | return HrUtils.getCurrentHr(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vuehr/src/utils/filter_utils.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | Vue.filter("formatDate", formatDate); 3 | Vue.prototype.formatDate = formatDate; 4 | function formatDate(value) { 5 | var date = new Date(value); 6 | var year = date.getFullYear(); 7 | var month = date.getMonth() + 1; 8 | var day = date.getDate(); 9 | if (month < 10) { 10 | month = "0" + month; 11 | } 12 | if (day < 10) { 13 | day = "0" + day; 14 | } 15 | return year + "-" + month + "-" + day; 16 | } 17 | Vue.filter("formatDateTime", function formatDateTime(value) { 18 | var date = new Date(value); 19 | var year = date.getFullYear(); 20 | var month = date.getMonth() + 1; 21 | var day = date.getDate(); 22 | var hours = date.getHours(); 23 | var minutes = date.getMinutes(); 24 | if (month < 10) { 25 | month = "0" + month; 26 | } 27 | if (day < 10) { 28 | day = "0" + day; 29 | } 30 | return year + "-" + month + "-" + day + " " + hours + ":" + minutes; 31 | }); 32 | 33 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package org.sang.config; 2 | 3 | import org.sang.common.DateConverter; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.format.FormatterRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 9 | 10 | import java.util.concurrent.ExecutorService; 11 | import java.util.concurrent.Executors; 12 | 13 | /** 14 | * Created by sang on 2018/1/2. 15 | */ 16 | @Configuration 17 | public class WebMvcConfig implements WebMvcConfigurer { 18 | @Override 19 | public void addFormatters(FormatterRegistry registry) { 20 | registry.addConverter(new DateConverter()); 21 | } 22 | 23 | @Bean 24 | public ExecutorService executorService() { 25 | return Executors.newCachedThreadPool(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.Role; 4 | import org.sang.mapper.RoleMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Created by sang on 2018/1/1. 13 | */ 14 | @Service 15 | @Transactional 16 | public class RoleService { 17 | @Autowired 18 | RoleMapper roleMapper; 19 | 20 | public List roles() { 21 | return roleMapper.roles(); 22 | } 23 | 24 | public int addNewRole(String role, String roleZh) { 25 | if (!role.startsWith("ROLE_")) { 26 | role = "ROLE_" + role; 27 | } 28 | return roleMapper.addNewRole(role, roleZh); 29 | } 30 | 31 | public int deleteRoleById(Long rid) { 32 | return roleMapper.deleteRoleById(rid); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/MsgContent.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * Created by sang on 2018/2/2. 7 | */ 8 | public class MsgContent { 9 | private Long id; 10 | private String message; 11 | private String title; 12 | private Date createDate; 13 | 14 | public String getTitle() { 15 | return title; 16 | } 17 | 18 | public void setTitle(String title) { 19 | this.title = title; 20 | } 21 | 22 | public Long getId() { 23 | return id; 24 | } 25 | 26 | public void setId(Long id) { 27 | this.id = id; 28 | } 29 | 30 | public String getMessage() { 31 | return message; 32 | } 33 | 34 | public void setMessage(String message) { 35 | this.message = message; 36 | } 37 | 38 | public Date getCreateDate() { 39 | return createDate; 40 | } 41 | 42 | public void setCreateDate(Date createDate) { 43 | this.createDate = createDate; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/RegLoginController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller; 2 | 3 | import org.sang.bean.RespBean; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.ResponseStatus; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import javax.servlet.http.HttpServletResponse; 11 | import java.io.IOException; 12 | import java.io.PrintWriter; 13 | 14 | /** 15 | * Created by sang on 2017/12/29. 16 | */ 17 | @RestController 18 | public class RegLoginController { 19 | @RequestMapping("/login_p") 20 | public RespBean login() { 21 | return RespBean.error("尚未登录,请登录!"); 22 | } 23 | 24 | @GetMapping("/employee/advanced/hello") 25 | public String hello() { 26 | return "hello"; 27 | } 28 | 29 | @GetMapping("/employee/basic/hello") 30 | public String basicHello() { 31 | return "basicHello"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/PositionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | INSERT INTO position set name=#{pos.name} 8 | 9 | 12 | 15 | 16 | DELETE FROM position WHERE id IN 17 | 18 | #{pid} 19 | 20 | 21 | 22 | UPDATE position set name=#{pos.name} WHERE id=#{pos.id} 23 | 24 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Nation.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | /** 4 | * Created by sang on 2018/1/12. 5 | */ 6 | public class Nation { 7 | private Long id; 8 | private String name; 9 | 10 | public Nation(String name) { 11 | this.name = name; 12 | } 13 | 14 | public Nation() { 15 | } 16 | 17 | @Override 18 | public boolean equals(Object o) { 19 | if (this == o) return true; 20 | if (o == null || getClass() != o.getClass()) return false; 21 | 22 | Nation nation = (Nation) o; 23 | 24 | return name != null ? name.equals(nation.name) : nation.name == null; 25 | } 26 | 27 | @Override 28 | public int hashCode() { 29 | return name != null ? name.hashCode() : 0; 30 | } 31 | 32 | public Long getId() { 33 | return id; 34 | } 35 | 36 | public void setId(Long id) { 37 | this.id = id; 38 | } 39 | 40 | public String getName() { 41 | return name; 42 | } 43 | 44 | public void setName(String name) { 45 | this.name = name; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Statistics.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class Statistics { 6 | 7 | private Long id; 8 | private Long eid; 9 | private String type; 10 | private Date tDate; 11 | private String remark; 12 | 13 | public Long getId() { 14 | return id; 15 | } 16 | 17 | public void setId(Long id) { 18 | this.id = id; 19 | } 20 | 21 | public Long getEid() { 22 | return eid; 23 | } 24 | 25 | public void setEid(Long eid) { 26 | this.eid = eid; 27 | } 28 | 29 | public String getType() { 30 | return type; 31 | } 32 | 33 | public void setType(String type) { 34 | this.type = type; 35 | } 36 | 37 | public Date gettDate() { 38 | return tDate; 39 | } 40 | 41 | public void settDate(Date tDate) { 42 | this.tDate = tDate; 43 | } 44 | 45 | public String getRemark() { 46 | return remark; 47 | } 48 | 49 | public void setRemark(String remark) { 50 | this.remark = remark; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 项目整体功能结构 3 | 4 | ![图片描述](https://doc.shiyanlou.com/courses/uid987099-20190806-1565083158238/wm) 5 | 6 | 项目总共分为五大功能模块,分别是员工资料、人事管理、薪酬管理、统计管理和系统管理 7 | 8 | ## 快速启动 9 | 10 | 在实验环境中,创建好数据库后,切换工作空间进入`vhr`目录通过`mvn spring-boot:run`就可以运行了。 11 | 12 | 如果不在实验楼的在线环境运行,要在自己本地环境运行就需要以下步骤: 13 | 14 | 1.下载项目到本地 15 | 16 | 2.在 MySQL 中执行数据库脚本 17 | 18 | 3.将 application.properties 文件中的`server.port`改成 8082,因为前端启动的时候会占用 8080 端口 19 | 20 | 4.在 IntelliJ IDEA 中运行 vhr 项目 21 | 22 | **OK,至此,服务端就启动成功了,此时我们直接在地址栏输入http://localhost:8082/index.html 即可访问我们的项目,如果要做二次开发,请继续看第五、六步。** 23 | 24 | 5.进入到 vuehr 目录中,在命令行依次输入如下命令: 25 | 26 | ```bash 27 | # 安装依赖 28 | npm install 29 | 30 | # 在 localhost:8080 启动项目 31 | npm run dev 32 | ``` 33 | 34 | 由于我在 vuehr 项目中已经配置了端口转发,将数据转发到 SpringBoot 上,因此项目启动之后,在浏览器中输入 http://localhost:8080 就可以访问我们的前端项目了,所有的请求通过端口转发将数据传到 SpringBoot 中(注意此时不要关闭 SpringBoot 项目)。 35 | 36 | 6.最后可以用 IntelliJ IDEA 等工具打开 vuehr 项目,继续开发,开发完成后,当项目要上线时,依然进入到 vuehr 目录,然后执行如下命令: 37 | 38 | ```bash 39 | npm run build 40 | ``` 41 | 42 | 该命令执行成功之后,vuehr 目录下生成一个 dist 文件夹,将该文件夹中的两个文件 static 和 index.html 拷贝到 SpringBoot 项目中 resources/static/目录下,然后就可以像第 4 步那样直接访问了。 43 | 44 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/PoliticsStatus.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | /** 4 | * Created by sang on 2018/1/13. 5 | */ 6 | public class PoliticsStatus { 7 | private Long id; 8 | private String name; 9 | 10 | @Override 11 | public boolean equals(Object o) { 12 | if (this == o) return true; 13 | if (o == null || getClass() != o.getClass()) return false; 14 | 15 | PoliticsStatus that = (PoliticsStatus) o; 16 | 17 | return name != null ? name.equals(that.name) : that.name == null; 18 | } 19 | 20 | @Override 21 | public int hashCode() { 22 | return name != null ? name.hashCode() : 0; 23 | } 24 | 25 | public PoliticsStatus(String name) { 26 | 27 | this.name = name; 28 | } 29 | 30 | public PoliticsStatus() { 31 | 32 | } 33 | 34 | public Long getId() { 35 | return id; 36 | } 37 | 38 | public void setId(Long id) { 39 | this.id = id; 40 | } 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | public void setName(String name) { 47 | this.name = name; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/config/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package org.sang.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.messaging.simp.config.MessageBrokerRegistry; 5 | import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer; 6 | import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; 7 | import org.springframework.web.socket.config.annotation.StompEndpointRegistry; 8 | import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; 9 | 10 | /** 11 | * Created by sang on 2018/1/27. 12 | */ 13 | @Configuration 14 | @EnableWebSocketMessageBroker 15 | public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { 16 | @Override 17 | public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) { 18 | stompEndpointRegistry.addEndpoint("/ws/endpointChat").withSockJS(); 19 | } 20 | 21 | @Override 22 | public void configureMessageBroker(MessageBrokerRegistry registry) { 23 | registry.enableSimpleBroker("/queue","/topic"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/exception/CustomExceptionResolver.java: -------------------------------------------------------------------------------- 1 | package org.sang.exception; 2 | 3 | import org.springframework.dao.DataIntegrityViolationException; 4 | import org.springframework.stereotype.Component; 5 | import org.springframework.web.servlet.HandlerExceptionResolver; 6 | import org.springframework.web.servlet.ModelAndView; 7 | import org.springframework.web.servlet.view.json.MappingJackson2JsonView; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | /** 15 | * Created by sang on 2018/1/2. 16 | */ 17 | @Component 18 | public class CustomExceptionResolver implements HandlerExceptionResolver { 19 | @Override 20 | public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse response, Object o, Exception e) { 21 | ModelAndView mv = new ModelAndView(new MappingJackson2JsonView()); 22 | Map map = new HashMap<>(); 23 | map.put("status", 500); 24 | map.put("msg", "操作失败!"); 25 | mv.addAllObjects(map); 26 | return mv; 27 | } 28 | } -------------------------------------------------------------------------------- /vuehr/src/components/system/SysBasic.vue: -------------------------------------------------------------------------------- 1 | 19 | 39 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/WsController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller; 2 | 3 | import org.sang.bean.ChatResp; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.messaging.handler.annotation.MessageMapping; 6 | import org.springframework.messaging.handler.annotation.SendTo; 7 | import org.springframework.messaging.simp.SimpMessagingTemplate; 8 | import org.springframework.stereotype.Controller; 9 | 10 | import java.security.Principal; 11 | 12 | /** 13 | * WebSocket 消息处理类 14 | * Created by sang on 2018/1/27. 15 | */ 16 | @Controller 17 | public class WsController { 18 | @Autowired 19 | SimpMessagingTemplate messagingTemplate; 20 | 21 | @MessageMapping("/ws/chat") 22 | public void handleChat(Principal principal, String msg) { 23 | String destUser = msg.substring(msg.lastIndexOf(";") + 1, msg.length()); 24 | String message = msg.substring(0, msg.lastIndexOf(";")); 25 | messagingTemplate.convertAndSendToUser(destUser, "/queue/chat", new ChatResp(message, principal.getName())); 26 | } 27 | 28 | @MessageMapping("/ws/nf") 29 | @SendTo("/topic/nf") 30 | public String handleNF() { 31 | return "系统消息"; 32 | } 33 | } -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/MenuService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.Menu; 4 | import org.sang.common.HrUtils; 5 | import org.sang.mapper.MenuMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.cache.annotation.CacheConfig; 8 | import org.springframework.cache.annotation.Cacheable; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Created by sang on 2017/12/28. 16 | */ 17 | @Service 18 | @Transactional 19 | @CacheConfig(cacheNames = "menus_cache") 20 | public class MenuService { 21 | @Autowired 22 | MenuMapper menuMapper; 23 | 24 | // @Cacheable(key = "#root.methodName") 25 | public List getAllMenu(){ 26 | return menuMapper.getAllMenu(); 27 | } 28 | 29 | public List getMenusByHrId() { 30 | return menuMapper.getMenusByHrId(HrUtils.getCurrentHr().getId()); 31 | } 32 | 33 | public List menuTree() { 34 | return menuMapper.menuTree(); 35 | } 36 | 37 | public List getMenusByRid(Long rid) { 38 | return menuMapper.getMenusByRid(rid); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/PositionService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.JobLevel; 4 | import org.sang.bean.Position; 5 | import org.sang.mapper.PositionMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by sang on 2018/1/10. 14 | */ 15 | @Service 16 | @Transactional 17 | public class PositionService { 18 | @Autowired 19 | PositionMapper positionMapper; 20 | 21 | public int addPos(Position pos) { 22 | if (positionMapper.getPosByName(pos.getName()) != null) { 23 | return -1; 24 | } 25 | return positionMapper.addPos(pos); 26 | } 27 | 28 | public List getAllPos() { 29 | return positionMapper.getAllPos(); 30 | } 31 | 32 | public boolean deletePosById(String pids) { 33 | String[] split = pids.split(","); 34 | return positionMapper.deletePosById(split) == split.length; 35 | } 36 | 37 | public int updatePosById(Position position) { 38 | return positionMapper.updatePosById(position); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/personnel/EmpEcController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.personnel; 2 | 3 | import org.sang.bean.EmpEc; 4 | import org.sang.bean.RespBean; 5 | import org.sang.service.EmpService; 6 | import org.sang.service.PersonnelService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | 13 | @RestController 14 | @RequestMapping("/personnel/ec") 15 | public class EmpEcController { 16 | 17 | @Autowired 18 | EmpService empService; 19 | 20 | @Autowired 21 | PersonnelService personnelService; 22 | 23 | @RequestMapping(value = "/addec", method = RequestMethod.POST) 24 | public RespBean addEc(EmpEc ec){ 25 | 26 | if(empService.getEmpById(ec.getEid())==null){ 27 | return RespBean.error("员工号不存在"); 28 | } 29 | //Long eid=empService.getId(name, workID); 30 | if(personnelService.addEc(ec)==1){ 31 | return RespBean.ok("添加成功!"); 32 | } 33 | return RespBean.error("添加失败"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/JobLevelService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.JobLevel; 4 | import org.sang.mapper.JobLevelMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Created by sang on 2018/1/11. 13 | */ 14 | @Service 15 | @Transactional 16 | public class JobLevelService { 17 | @Autowired 18 | JobLevelMapper jobLevelMapper; 19 | 20 | public int addJobLevel(JobLevel jobLevel) { 21 | if (jobLevelMapper.getJobLevelByName(jobLevel.getName()) != null) { 22 | return -1; 23 | } 24 | return jobLevelMapper.addJobLevel(jobLevel); 25 | } 26 | 27 | public List getAllJobLevels() { 28 | return jobLevelMapper.getAllJobLevels(); 29 | } 30 | 31 | public boolean deleteJobLevelById(String ids) { 32 | String[] split = ids.split(","); 33 | return jobLevelMapper.deleteJobLevelById(split) == split.length; 34 | } 35 | 36 | public int updateJobLevel(JobLevel jobLevel) { 37 | return jobLevelMapper.updateJobLevel(jobLevel); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/config/AuthenticationAccessDeniedHandler.java: -------------------------------------------------------------------------------- 1 | package org.sang.config; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import org.sang.bean.RespBean; 5 | import org.springframework.security.access.AccessDeniedException; 6 | import org.springframework.security.web.access.AccessDeniedHandler; 7 | import org.springframework.stereotype.Component; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.io.IOException; 13 | import java.io.PrintWriter; 14 | 15 | /** 16 | * Created by sang on 2017/12/29. 17 | */ 18 | @Component 19 | public class AuthenticationAccessDeniedHandler implements AccessDeniedHandler { 20 | @Override 21 | public void handle(HttpServletRequest httpServletRequest, HttpServletResponse resp, 22 | AccessDeniedException e) throws IOException { 23 | resp.setStatus(HttpServletResponse.SC_FORBIDDEN); 24 | resp.setContentType("application/json;charset=UTF-8"); 25 | PrintWriter out = resp.getWriter(); 26 | RespBean error = RespBean.error("权限不足,请联系管理员!"); 27 | out.write(new ObjectMapper().writeValueAsString(error)); 28 | out.flush(); 29 | out.close(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/DepartmentService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.Department; 4 | import org.sang.mapper.DepartmentMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import java.util.HashMap; 10 | import java.util.List; 11 | import java.util.Map; 12 | 13 | /** 14 | * Created by sang on 2018/1/7. 15 | */ 16 | @Service 17 | @Transactional 18 | public class DepartmentService { 19 | @Autowired 20 | DepartmentMapper departmentMapper; 21 | public int addDep(Department department) { 22 | department.setEnabled(true); 23 | departmentMapper.addDep(department); 24 | return department.getResult(); 25 | } 26 | 27 | public int deleteDep(Long did) { 28 | Department department = new Department(); 29 | department.setId(did); 30 | departmentMapper.deleteDep(department); 31 | return department.getResult(); 32 | } 33 | 34 | public List getDepByPid(Long pid) { 35 | return departmentMapper.getDepByPid(pid); 36 | } 37 | 38 | public List getAllDeps() { 39 | return departmentMapper.getAllDeps(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/InfoStatistics.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | public class InfoStatistics { 4 | 5 | private Integer id; 6 | private String depName; 7 | private Integer peopleCount; 8 | private Integer joinCount; 9 | 10 | public Integer getId() { 11 | return id; 12 | } 13 | 14 | public void setId(Integer id) { 15 | this.id = id; 16 | } 17 | 18 | public String getDepName() { 19 | return depName; 20 | } 21 | 22 | public void setDepName(String depName) { 23 | this.depName = depName; 24 | } 25 | 26 | public Integer getPeopleCount() { 27 | return peopleCount; 28 | } 29 | 30 | public void setPeopleCount(Integer peopleCount) { 31 | this.peopleCount = peopleCount; 32 | } 33 | 34 | 35 | public Integer getJoinCount() { 36 | return joinCount; 37 | } 38 | 39 | public void setJoinCount(Integer joinCount) { 40 | this.joinCount = joinCount; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "InfoStatistics{" + 46 | "id=" + id + 47 | ", depName='" + depName + '\'' + 48 | ", peopleCount=" + peopleCount + 49 | ", joinCount=" + joinCount + 50 | '}'; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/SysMsg.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | /** 4 | * Created by sang on 2018/2/2. 5 | */ 6 | public class SysMsg { 7 | private Long id; 8 | private Long mid; 9 | private Integer type; 10 | private Long hrid; 11 | private Integer state; 12 | private MsgContent msgContent; 13 | 14 | public MsgContent getMsgContent() { 15 | return msgContent; 16 | } 17 | 18 | public void setMsgContent(MsgContent msgContent) { 19 | this.msgContent = msgContent; 20 | } 21 | 22 | public Long getId() { 23 | return id; 24 | } 25 | 26 | public void setId(Long id) { 27 | this.id = id; 28 | } 29 | 30 | public Long getMid() { 31 | return mid; 32 | } 33 | 34 | public void setMid(Long mid) { 35 | this.mid = mid; 36 | } 37 | 38 | public Integer getType() { 39 | return type; 40 | } 41 | 42 | public void setType(Integer type) { 43 | this.type = type; 44 | } 45 | 46 | public Long getHrid() { 47 | return hrid; 48 | } 49 | 50 | public void setHrid(Long hrid) { 51 | this.hrid = hrid; 52 | } 53 | 54 | public Integer getState() { 55 | return state; 56 | } 57 | 58 | public void setState(Integer state) { 59 | this.state = state; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /hrserver/src/main/resources/templates/email.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

你好, 9 | 童鞋,欢迎加入XXX大家庭!您的入职信息如下:

10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
工号
合同期限
合同起始日期
合同截至日期
所属部门
职位
36 |

37 | 38 | 希望在未来的日子里,携手共进! 39 | 40 |

41 | 42 | -------------------------------------------------------------------------------- /vuehr/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // if you are using ts-loader, setting this to true will make tyescript errors show up during build 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/EmpEc.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class EmpEc { 6 | 7 | private Long id; 8 | private Long eid; 9 | private Date ecDate; 10 | private String ecReason; 11 | private int ecType; 12 | private String remark; 13 | 14 | public Long getId() { 15 | return id; 16 | } 17 | 18 | public void setId(Long id) { 19 | this.id = id; 20 | } 21 | 22 | public int getEcType() { 23 | return ecType; 24 | } 25 | 26 | public void setEcType(int ecType) { 27 | this.ecType = ecType; 28 | } 29 | 30 | public Long getEid() { 31 | return eid; 32 | } 33 | 34 | public void setEid(Long eid) { 35 | this.eid = eid; 36 | } 37 | 38 | public Date getEcDate() { 39 | return ecDate; 40 | } 41 | 42 | public void setEcDate(Date ecDate) { 43 | this.ecDate = ecDate; 44 | } 45 | 46 | public String getEcReason() { 47 | return ecReason; 48 | } 49 | 50 | public void setEcReason(String ecReason) { 51 | this.ecReason = ecReason; 52 | } 53 | 54 | 55 | public String getRemark() { 56 | return remark; 57 | } 58 | 59 | public void setRemark(String remark) { 60 | this.remark = remark; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Position.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * Created by sang on 2018/1/10. 7 | */ 8 | public class Position { 9 | private Long id; 10 | private String name; 11 | private Timestamp createDate; 12 | 13 | public Position() { 14 | } 15 | 16 | @Override 17 | public boolean equals(Object o) { 18 | if (this == o) return true; 19 | if (o == null || getClass() != o.getClass()) return false; 20 | 21 | Position position = (Position) o; 22 | 23 | return name != null ? name.equals(position.name) : position.name == null; 24 | } 25 | 26 | @Override 27 | public int hashCode() { 28 | return name != null ? name.hashCode() : 0; 29 | } 30 | 31 | public Position(String name) { 32 | 33 | this.name = name; 34 | } 35 | 36 | public Long getId() { 37 | return id; 38 | } 39 | 40 | public void setId(Long id) { 41 | this.id = id; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public void setName(String name) { 49 | this.name = name; 50 | } 51 | 52 | public Timestamp getCreateDate() { 53 | return createDate; 54 | } 55 | 56 | public void setCreateDate(Timestamp createDate) { 57 | this.createDate = createDate; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/JobLevelMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | INSERT INTO joblevel SET name=#{jobLevel.name},titleLevel=#{jobLevel.titleLevel} 11 | 12 | 15 | 16 | DELETE FROM joblevel WHERE id IN 17 | 18 | #{id} 19 | 20 | 21 | 22 | UPDATE joblevel 23 | 24 | 25 | name=#{jobLevel.name}, 26 | 27 | 28 | titleLevel=#{jobLevel.titleLevel}, 29 | 30 | 31 | WHERE id=#{jobLevel.id} 32 | 33 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/PersonnelMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.AdjustSalary; 5 | import org.sang.bean.EmpEc; 6 | import org.sang.bean.EmpMove; 7 | import org.sang.bean.EmpTrain; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | @Repository 13 | public interface PersonnelMapper { 14 | 15 | 16 | int addEc(EmpEc empEc); 17 | 18 | List getAllEmpEc(); 19 | 20 | 21 | 22 | int addEmpTrain(@Param("empTrain") EmpTrain empTrain); 23 | 24 | int updateEmpTrain(@Param("empTrain") EmpTrain empTrain); 25 | 26 | int deleteEmpTrain(@Param("ids") String[] ids); 27 | 28 | List getAllEmpTrains(); 29 | 30 | 31 | 32 | int addAdjustSalary(@Param("adjustSalary") AdjustSalary adjustSalary); 33 | 34 | int updateAdjustSalary(@Param("adjustSalary") AdjustSalary adjustSalary); 35 | 36 | int deleteAdjustSalary(@Param("ids") String[] ids); 37 | 38 | List getAllAdjustSalary(); 39 | 40 | 41 | 42 | 43 | int addEmpMove(@Param("empMove") EmpMove empMove); 44 | 45 | int updateEmpMove(@Param("empMove") EmpMove empMove); 46 | 47 | int deleteEmpMove(@Param("ids") String[] ids); 48 | 49 | List getAllEmpMove(); 50 | 51 | int updateDepIdAndJobId(@Param("empMove") EmpMove empMove); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/SalSearch.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | public class SalSearch { 4 | 5 | private Long id; 6 | private Long eid; 7 | private String name; 8 | private String workID; 9 | private Integer bonus; 10 | private Integer fine; 11 | private Integer payment; 12 | 13 | public Long getId() { 14 | return id; 15 | } 16 | 17 | public void setId(Long id) { 18 | this.id = id; 19 | } 20 | 21 | public Long getEid() { 22 | return eid; 23 | } 24 | 25 | public void setEid(Long eid) { 26 | this.eid = eid; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public String getWorkID() { 38 | return workID; 39 | } 40 | 41 | public void setWorkID(String workID) { 42 | this.workID = workID; 43 | } 44 | 45 | public Integer getBonus() { 46 | return bonus; 47 | } 48 | 49 | public void setBonus(Integer bonus) { 50 | this.bonus = bonus; 51 | } 52 | 53 | public Integer getFine() { 54 | return fine; 55 | } 56 | 57 | public void setFine(Integer fine) { 58 | this.fine = fine; 59 | } 60 | 61 | public Integer getPayment() { 62 | return payment; 63 | } 64 | 65 | public void setPayment(Integer payment) { 66 | this.payment = payment; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/DepartmentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 26 | -------------------------------------------------------------------------------- /vuehr/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/SalaryMan.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | public class SalaryMan { 4 | 5 | private Long id; 6 | private Long eid; 7 | private String name; 8 | private String workID; 9 | private Integer lateCount; 10 | private Integer leaveCount; 11 | private Integer overtime; 12 | 13 | public Long getId() { 14 | return id; 15 | } 16 | 17 | public void setId(Long id) { 18 | this.id = id; 19 | } 20 | 21 | public Long getEid() { 22 | return eid; 23 | } 24 | 25 | public void setEid(Long eid) { 26 | this.eid = eid; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public String getWorkID() { 38 | return workID; 39 | } 40 | 41 | public void setWorkID(String workID) { 42 | this.workID = workID; 43 | } 44 | 45 | public Integer getLateCount() { 46 | return lateCount; 47 | } 48 | 49 | public void setLateCount(Integer lateCount) { 50 | this.lateCount = lateCount; 51 | } 52 | 53 | public Integer getLeaveCount() { 54 | return leaveCount; 55 | } 56 | 57 | public void setLeaveCount(Integer leaveCount) { 58 | this.leaveCount = leaveCount; 59 | } 60 | 61 | public Integer getOvertime() { 62 | return overtime; 63 | } 64 | 65 | public void setOvertime(Integer overtime) { 66 | this.overtime = overtime; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/RespBean.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | public class RespBean { 4 | private Integer status; 5 | private String msg; 6 | private Object obj; 7 | 8 | private RespBean() { 9 | } 10 | 11 | public static RespBean build() { 12 | return new RespBean(); 13 | } 14 | 15 | public static RespBean ok(String msg, Object obj) { 16 | return new RespBean(200, msg, obj); 17 | } 18 | 19 | public static RespBean ok(String msg) { 20 | return new RespBean(200, msg, null); 21 | } 22 | 23 | public static RespBean error(String msg, Object obj) { 24 | return new RespBean(500, msg, obj); 25 | } 26 | 27 | public static RespBean error(String msg) { 28 | return new RespBean(500, msg, null); 29 | } 30 | 31 | private RespBean(Integer status, String msg, Object obj) { 32 | this.status = status; 33 | this.msg = msg; 34 | this.obj = obj; 35 | } 36 | 37 | public Integer getStatus() { 38 | 39 | return status; 40 | } 41 | 42 | public RespBean setStatus(Integer status) { 43 | this.status = status; 44 | return this; 45 | } 46 | 47 | public String getMsg() { 48 | return msg; 49 | } 50 | 51 | public RespBean setMsg(String msg) { 52 | this.msg = msg; 53 | return this; 54 | } 55 | 56 | public Object getObj() { 57 | return obj; 58 | } 59 | 60 | public RespBean setObj(Object obj) { 61 | this.obj = obj; 62 | return this; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/EmpTrain.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class EmpTrain { 6 | 7 | private Long id; 8 | private Long eid; 9 | private Date trainDate; 10 | private String trainContent; 11 | private String remark; 12 | 13 | public Long getId() { 14 | return id; 15 | } 16 | 17 | public void setId(Long id) { 18 | this.id = id; 19 | } 20 | 21 | public Long getEid() { 22 | return eid; 23 | } 24 | 25 | public void setEid(Long eid) { 26 | this.eid = eid; 27 | } 28 | 29 | public Date getTrainDate() { 30 | return trainDate; 31 | } 32 | 33 | public void setTrainDate(Date trainDate) { 34 | this.trainDate = trainDate; 35 | } 36 | 37 | public String getTrainContent() { 38 | return trainContent; 39 | } 40 | 41 | public void setTrainContent(String trainContent) { 42 | this.trainContent = trainContent; 43 | } 44 | 45 | public String getRemark() { 46 | return remark; 47 | } 48 | 49 | public void setRemark(String remark) { 50 | this.remark = remark; 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return "EmpTrain{" + 56 | "id=" + id + 57 | ", eid=" + eid + 58 | ", trainDate=" + trainDate + 59 | ", trainContent='" + trainContent + '\'' + 60 | ", remark='" + remark + '\'' + 61 | '}'; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/statistics/InfoStatisticsController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.statistics; 2 | 3 | import org.sang.bean.Department; 4 | import org.sang.bean.InfoStatistics; 5 | import org.sang.service.StatisticsService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestMethod; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import java.util.ArrayList; 12 | import java.util.LinkedList; 13 | import java.util.List; 14 | 15 | @RestController 16 | @RequestMapping("/statistics/all") 17 | public class InfoStatisticsController { 18 | 19 | @Autowired 20 | StatisticsService statisticsService; 21 | 22 | @RequestMapping(value = "/info",method = RequestMethod.GET) 23 | public List getAllInfo(){ 24 | 25 | List infoStatisticsList=new LinkedList<>(); 26 | 27 | List departments=new ArrayList<>(); 28 | departments=statisticsService.getAllDeps(); 29 | 30 | for (Department department:departments){ 31 | InfoStatistics infoStatistics=new InfoStatistics(); 32 | infoStatistics.setDepName(department.getName()); 33 | infoStatistics.setPeopleCount(statisticsService.getAllPeoplebyDepId(department.getId())); 34 | infoStatistics.setJoinCount(statisticsService.getJoinCount(department.getId())); 35 | infoStatisticsList.add(infoStatistics); 36 | } 37 | return infoStatisticsList; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/SysMsgService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.Hr; 4 | import org.sang.bean.MsgContent; 5 | import org.sang.bean.SysMsg; 6 | import org.sang.common.HrUtils; 7 | import org.sang.mapper.SysMsgMapper; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.security.access.prepost.PreAuthorize; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * Created by sang on 2018/2/2. 17 | */ 18 | @Service 19 | @Transactional 20 | public class SysMsgService { 21 | @Autowired 22 | SysMsgMapper sysMsgMapper; 23 | @Autowired 24 | HrService hrService; 25 | 26 | @PreAuthorize("hasRole('ROLE_admin')")//只有管理员可以发送系统消息 27 | public boolean sendMsg(MsgContent msg) { 28 | int result = sysMsgMapper.sendMsg(msg); 29 | List
allHr = hrService.getAllHr(); 30 | int result2 = sysMsgMapper.addMsg2AllHr(allHr, msg.getId()); 31 | return result2==allHr.size(); 32 | } 33 | 34 | public List getSysMsgByPage(Integer page, Integer size) { 35 | int start = (page - 1) * size; 36 | return sysMsgMapper.getSysMsg(start,size, HrUtils.getCurrentHr().getId()); 37 | } 38 | 39 | public boolean markRead(Long flag) { 40 | if (flag != -1) { 41 | return sysMsgMapper.markRead(flag,HrUtils.getCurrentHr().getId())==1; 42 | } 43 | sysMsgMapper.markRead(flag,HrUtils.getCurrentHr().getId()); 44 | return true; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/JobLevel.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * Created by sang on 2018/1/11. 7 | */ 8 | public class JobLevel { 9 | private Long id; 10 | private String name; 11 | private String titleLevel; 12 | private Timestamp createDate; 13 | 14 | @Override 15 | public boolean equals(Object o) { 16 | if (this == o) return true; 17 | if (o == null || getClass() != o.getClass()) return false; 18 | 19 | JobLevel jobLevel = (JobLevel) o; 20 | 21 | return name != null ? name.equals(jobLevel.name) : jobLevel.name == null; 22 | } 23 | 24 | @Override 25 | public int hashCode() { 26 | return name != null ? name.hashCode() : 0; 27 | } 28 | 29 | public JobLevel() { 30 | 31 | } 32 | 33 | public JobLevel(String name) { 34 | 35 | this.name = name; 36 | } 37 | 38 | public Long getId() { 39 | return id; 40 | } 41 | 42 | public void setId(Long id) { 43 | this.id = id; 44 | } 45 | 46 | public String getName() { 47 | return name; 48 | } 49 | 50 | public void setName(String name) { 51 | this.name = name; 52 | } 53 | 54 | public String getTitleLevel() { 55 | return titleLevel; 56 | } 57 | 58 | public void setTitleLevel(String titleLevel) { 59 | this.titleLevel = titleLevel; 60 | } 61 | 62 | public Timestamp getCreateDate() { 63 | return createDate; 64 | } 65 | 66 | public void setCreateDate(Timestamp createDate) { 67 | this.createDate = createDate; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /hrserver/src/main/resources/static/static/js/manifest.a15c571fcebaca4d03a9.js: -------------------------------------------------------------------------------- 1 | !function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var f,i,u,d=0,s=[];d getAllSalary() { 24 | return salaryMapper.getAllSalary(); 25 | } 26 | 27 | public int updateSalary(Salary salary) { 28 | return salaryMapper.updateSalary(salary); 29 | } 30 | 31 | public int deleteSalary(String ids) { 32 | String[] split = ids.split(","); 33 | return salaryMapper.deleteSalary(split); 34 | } 35 | 36 | public int updateEmpSalary(Integer sid, Long eid) { 37 | salaryMapper.deleteSalaryByEid(eid); 38 | return salaryMapper.addSidAndEid(sid,eid); 39 | } 40 | 41 | 42 | public int getLeaveCount(Long eid){ 43 | return salaryMapper.getLeaveCount(eid); 44 | } 45 | 46 | public int getLateCount(Long eid){ 47 | return salaryMapper.getLateCount(eid); 48 | } 49 | 50 | public int getOvertime(Long eid){ 51 | return salaryMapper.getOvertime(eid); 52 | } 53 | 54 | public Salary getSalaryById(Long id){ 55 | return salaryMapper.getSalaryById(id); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /vuehr/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import ElementUI from 'element-ui' 7 | import 'element-ui/lib/theme-chalk/index.css' 8 | import store from './store' 9 | import {getRequest} from './utils/api' 10 | import {postRequest} from './utils/api' 11 | import {deleteRequest} from './utils/api' 12 | import {putRequest} from './utils/api' 13 | import {initMenu} from './utils/utils' 14 | import {isNotNullORBlank} from './utils/utils' 15 | import './utils/filter_utils' 16 | import 'font-awesome/css/font-awesome.min.css' 17 | 18 | Vue.config.productionTip = false 19 | Vue.use(ElementUI) 20 | 21 | Vue.prototype.getRequest = getRequest; 22 | Vue.prototype.postRequest = postRequest; 23 | Vue.prototype.deleteRequest = deleteRequest; 24 | Vue.prototype.putRequest = putRequest; 25 | Vue.prototype.isNotNullORBlank = isNotNullORBlank; 26 | 27 | router.beforeEach((to, from, next)=> { 28 | if (to.name == 'Login') { 29 | next(); 30 | return; 31 | } 32 | var name = store.state.user.name; 33 | if (name == '未登录') { 34 | if (to.meta.requireAuth || to.name == null) { 35 | next({path: '/', query: {redirect: to.path}}) 36 | } else { 37 | next(); 38 | } 39 | } else { 40 | initMenu(router, store); 41 | if(to.path=='/chat') 42 | store.commit("updateMsgList", []); 43 | next(); 44 | } 45 | } 46 | ) 47 | 48 | new Vue({ 49 | el: '#app', 50 | router, 51 | store, 52 | template: '', 53 | components: {App} 54 | }) 55 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/EmpMapper.java: -------------------------------------------------------------------------------- 1 | package org.sang.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.sang.bean.Employee; 5 | import org.sang.bean.Nation; 6 | import org.sang.bean.PoliticsStatus; 7 | 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | /** 12 | * Created by sang on 2018/1/12. 13 | */ 14 | public interface EmpMapper { 15 | List getAllNations(); 16 | 17 | List getAllPolitics(); 18 | 19 | int addEmp(Employee employee); 20 | 21 | Long getMaxWorkID(); 22 | 23 | List getEmployeeByPage(@Param("start") Integer start, @Param("size") Integer size, @Param("keywords") String keywords, @Param("politicId") Long politicId, @Param("nationId") Long nationId, @Param("posId") Long posId, @Param("jobLevelId") Long jobLevelId, @Param("engageForm") String engageForm, @Param("departmentId")Long departmentId, @Param("startBeginDate") Date startBeginDate, @Param("endBeginDate") Date endBeginDate); 24 | 25 | Long getCountByKeywords(@Param("keywords") String keywords, @Param("politicId") Long politicId, @Param("nationId") Long nationId, @Param("posId") Long posId, @Param("jobLevelId") Long jobLevelId, @Param("engageForm") String engageForm, @Param("departmentId")Long departmentId, @Param("startBeginDate") Date startBeginDate, @Param("endBeginDate") Date endBeginDate); 26 | 27 | int updateEmp(@Param("emp") Employee employee); 28 | 29 | int deleteEmpById(@Param("ids") String[] ids); 30 | 31 | int addEmps(@Param("emps") List emps); 32 | 33 | List getEmployeeByPageShort(@Param("start") int start, @Param("size") Integer size); 34 | 35 | Employee getEmpById(Long Id); 36 | 37 | //Employee getEmpByIdAndName(String workID,String name); 38 | } 39 | -------------------------------------------------------------------------------- /hrserver/src/main/test/org/sang/PersonnelServiceTest.java: -------------------------------------------------------------------------------- 1 | package org.sang; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.sang.bean.AdjustSalary; 7 | import org.sang.bean.Department; 8 | import org.sang.bean.EmpTrain; 9 | import org.sang.bean.InfoStatistics; 10 | import org.sang.common.DateConverter; 11 | import org.sang.mapper.PersonnelMapper; 12 | import org.sang.service.PersonnelService; 13 | import org.sang.service.StatisticsService; 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 | import java.text.SimpleDateFormat; 19 | import java.util.ArrayList; 20 | import java.util.Date; 21 | import java.util.LinkedList; 22 | import java.util.List; 23 | 24 | @RunWith(SpringRunner.class) 25 | @SpringBootTest 26 | public class PersonnelServiceTest { 27 | 28 | @Autowired 29 | StatisticsService statisticsService; 30 | 31 | @Test 32 | public void test(){ 33 | 34 | List infoStatisticsList=new LinkedList<>(); 35 | 36 | List departments=new ArrayList<>(); 37 | departments=statisticsService.getAllDeps(); 38 | 39 | for (Department department:departments){ 40 | InfoStatistics infoStatistics=new InfoStatistics(); 41 | infoStatistics.setDepName(department.getName()); 42 | infoStatistics.setPeopleCount(statisticsService.getAllPeoplebyDepId(department.getId())); 43 | infoStatistics.setJoinCount(statisticsService.getJoinCount(department.getId())); 44 | infoStatisticsList.add(infoStatistics); 45 | } 46 | 47 | System.out.println(infoStatisticsList); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/personnel/EmpSalaryController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.personnel; 2 | 3 | import org.sang.bean.AdjustSalary; 4 | import org.sang.bean.RespBean; 5 | import org.sang.service.PersonnelService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import java.util.List; 13 | 14 | @RestController 15 | @RequestMapping("/personnel/adjust") 16 | public class EmpSalaryController { 17 | 18 | @Autowired 19 | PersonnelService personnelService; 20 | 21 | @RequestMapping(value = "/salary",method = RequestMethod.POST) 22 | public RespBean addAdjustSalary(AdjustSalary adjustSalary){ 23 | if(personnelService.addAdjustSalary(adjustSalary)==1){ 24 | return RespBean.ok("添加成功"); 25 | } 26 | return RespBean.error("添加失败"); 27 | } 28 | 29 | @RequestMapping(value = "/salary",method = RequestMethod.GET) 30 | public List getAllAdjustSalary(){ 31 | return personnelService.getAllAdjustSalary(); 32 | } 33 | 34 | @RequestMapping(value = "/salary",method = RequestMethod.PUT) 35 | public RespBean updateAdjustSalary(AdjustSalary adjustSalary){ 36 | if(personnelService.updateAdjustSalary(adjustSalary)==1){ 37 | return RespBean.ok("更新成功"); 38 | } 39 | return RespBean.error("更新失败"); 40 | } 41 | 42 | @RequestMapping(value = "/salary/{ids}",method = RequestMethod.DELETE) 43 | public RespBean deleteAdjustSalary(@PathVariable String ids){ 44 | if(personnelService.deleteAdjustSalary(ids)==1){ 45 | return RespBean.ok("删除成功"); 46 | } 47 | return RespBean.error("删除失败"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/personnel/EmpRemoveController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.personnel; 2 | 3 | import org.sang.bean.EmpMove; 4 | import org.sang.bean.RespBean; 5 | import org.sang.service.PersonnelService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import java.util.List; 13 | 14 | @RestController 15 | @RequestMapping("/personnel/remove") 16 | public class EmpRemoveController { 17 | 18 | @Autowired 19 | PersonnelService personnelService; 20 | 21 | @RequestMapping(value = "/move",method = RequestMethod.POST) 22 | public RespBean addEmpMove(EmpMove empMove){ 23 | if(personnelService.addEmpMove(empMove)==1 && personnelService.updateDepIdAndJobId(empMove)==1){ 24 | return RespBean.ok("添加成功"); 25 | } 26 | return RespBean.error("添加失败"); 27 | } 28 | 29 | @RequestMapping(value = "/move",method = RequestMethod.PUT) 30 | public RespBean updateEmpMove(EmpMove empMove){ 31 | if(personnelService.updateEmpMove(empMove)==1 && personnelService.updateDepIdAndJobId(empMove)==1){ 32 | return RespBean.ok("修改成功"); 33 | } 34 | return RespBean.error("修改失败"); 35 | } 36 | 37 | @RequestMapping(value = "/move",method = RequestMethod.GET) 38 | public List getAllEmpMove(){ 39 | return personnelService.getAllEmpMove(); 40 | } 41 | 42 | @RequestMapping(value = "/move/{ids}",method = RequestMethod.DELETE) 43 | public RespBean deleteEmpMove(@PathVariable String ids){ 44 | if(personnelService.deleteEmpMove(ids)==1){ 45 | return RespBean.ok("删除成功"); 46 | } 47 | return RespBean.error("删除失败"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/salary/SalaryController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.salary; 2 | 3 | import org.sang.bean.RespBean; 4 | import org.sang.bean.Salary; 5 | import org.sang.service.EmpService; 6 | import org.sang.service.SalaryService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * 工资账套配置 17 | */ 18 | @RestController 19 | @RequestMapping("/salary/sob") 20 | public class SalaryController { 21 | @Autowired 22 | SalaryService salaryService; 23 | @Autowired 24 | EmpService empService; 25 | 26 | @RequestMapping(value = "/salary", method = RequestMethod.POST) 27 | public RespBean addSalaryCfg(Salary salary) { 28 | if (salaryService.addSalary(salary) == 1) { 29 | return RespBean.ok("添加成功!"); 30 | } 31 | return RespBean.error("添加失败!"); 32 | } 33 | 34 | @RequestMapping(value = "/salary", method = RequestMethod.GET) 35 | public List salaries() { 36 | return salaryService.getAllSalary(); 37 | } 38 | 39 | @RequestMapping(value = "/salary", method = RequestMethod.PUT) 40 | public RespBean updateSalary(Salary salary) { 41 | if (salaryService.updateSalary(salary) == 1) { 42 | return RespBean.ok("更新成功!"); 43 | } 44 | return RespBean.error("更新失败!"); 45 | } 46 | 47 | @RequestMapping(value = "/salary/{ids}", method = RequestMethod.DELETE) 48 | public RespBean deleteSalary(@PathVariable String ids) { 49 | if (salaryService.deleteSalary(ids) == 1) { 50 | return RespBean.ok("删除成功!"); 51 | } 52 | return RespBean.error("删除失败!"); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/SysMsgMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | INSERT INTO msgcontent(message,title) VALUES(#{message},#{title}); 8 | 9 | 10 | INSERT INTO sysmsg(mid,hrid) VALUES 11 | 12 | (#{mid},#{hr.id}) 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | UPDATE sysmsg set state=1 WHERE hrid=#{hrid} 33 | 34 | AND mid=#{flag} 35 | 36 | 37 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/salary/SalaryEmpController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.salary; 2 | 3 | import org.sang.bean.Employee; 4 | import org.sang.bean.RespBean; 5 | import org.sang.bean.Salary; 6 | import org.sang.service.EmpService; 7 | import org.sang.service.SalaryService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import java.util.HashMap; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | /** 19 | * Created by sang on 2018/1/25. 20 | */ 21 | @RestController 22 | @RequestMapping("/salary/sobcfg") 23 | public class SalaryEmpController { 24 | @Autowired 25 | SalaryService salaryService; 26 | @Autowired 27 | EmpService empService; 28 | 29 | @RequestMapping(value = "/", method = RequestMethod.PUT) 30 | public RespBean updateEmpSalary(Integer sid, Long eid) { 31 | if (salaryService.updateEmpSalary(sid, eid) == 1) { 32 | return RespBean.ok("修改成功!"); 33 | } 34 | return RespBean.error("修改失败!"); 35 | } 36 | 37 | @RequestMapping(value = "/salaries", method = RequestMethod.GET) 38 | public List salaries() { 39 | return salaryService.getAllSalary(); 40 | } 41 | 42 | @RequestMapping(value = "/emp", method = RequestMethod.GET) 43 | public Map getEmployeeByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) { 44 | Map map = new HashMap<>(); 45 | List employeeByPage = empService.getEmployeeByPageShort(page, size); 46 | Long count = empService.getCountByKeywords("", null, null, null, null, null, null, null); 47 | map.put("emps", employeeByPage); 48 | map.put("count", count); 49 | return map; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/config/CustomMetadataSource.java: -------------------------------------------------------------------------------- 1 | package org.sang.config; 2 | 3 | import org.sang.bean.Menu; 4 | import org.sang.bean.Role; 5 | import org.sang.service.MenuService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.security.access.ConfigAttribute; 8 | import org.springframework.security.access.SecurityConfig; 9 | import org.springframework.security.web.FilterInvocation; 10 | import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource; 11 | import org.springframework.stereotype.Component; 12 | import org.springframework.util.AntPathMatcher; 13 | 14 | import java.util.Collection; 15 | import java.util.List; 16 | 17 | /** 18 | * Created by sang on 2017/12/28. 19 | */ 20 | @Component 21 | public class CustomMetadataSource implements FilterInvocationSecurityMetadataSource { 22 | @Autowired 23 | MenuService menuService; 24 | AntPathMatcher antPathMatcher = new AntPathMatcher(); 25 | @Override 26 | public Collection getAttributes(Object o) { 27 | String requestUrl = ((FilterInvocation) o).getRequestUrl(); 28 | List allMenu = menuService.getAllMenu(); 29 | for (Menu menu : allMenu) { 30 | if (antPathMatcher.match(menu.getUrl(), requestUrl) 31 | &&menu.getRoles().size()>0) { 32 | List roles = menu.getRoles(); 33 | int size = roles.size(); 34 | String[] values = new String[size]; 35 | for (int i = 0; i < size; i++) { 36 | values[i] = roles.get(i).getName(); 37 | } 38 | return SecurityConfig.createList(values); 39 | } 40 | } 41 | //没有匹配上的资源,都是登录访问 42 | return SecurityConfig.createList("ROLE_LOGIN"); 43 | } 44 | @Override 45 | public Collection getAllConfigAttributes() { 46 | return null; 47 | } 48 | @Override 49 | public boolean supports(Class aClass) { 50 | return FilterInvocation.class.isAssignableFrom(aClass); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/EmpMove.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class EmpMove { 6 | 7 | private Long id; 8 | private Long eid; 9 | private Long afterDepId; 10 | private Long afterJobId; 11 | private Date removeDate; 12 | private String reason; 13 | private String remark; 14 | 15 | public Long getId() { 16 | return id; 17 | } 18 | 19 | public void setId(Long id) { 20 | this.id = id; 21 | } 22 | 23 | public Long getEid() { 24 | return eid; 25 | } 26 | 27 | public void setEid(Long eid) { 28 | this.eid = eid; 29 | } 30 | 31 | public Long getAfterDepId() { 32 | return afterDepId; 33 | } 34 | 35 | public void setAfterDepId(Long afterDepId) { 36 | this.afterDepId = afterDepId; 37 | } 38 | 39 | public Long getAfterJobId() { 40 | return afterJobId; 41 | } 42 | 43 | public void setAfterJobId(Long afterJobId) { 44 | this.afterJobId = afterJobId; 45 | } 46 | 47 | public Date getRemoveDate() { 48 | return removeDate; 49 | } 50 | 51 | public void setRemoveDate(Date removeDate) { 52 | this.removeDate = removeDate; 53 | } 54 | 55 | public String getReason() { 56 | return reason; 57 | } 58 | 59 | public void setReason(String reason) { 60 | this.reason = reason; 61 | } 62 | 63 | public String getRemark() { 64 | return remark; 65 | } 66 | 67 | public void setRemark(String remark) { 68 | this.remark = remark; 69 | } 70 | 71 | @Override 72 | public String toString() { 73 | return "EmpMove{" + 74 | "id=" + id + 75 | ", eid=" + eid + 76 | ", afterDepId=" + afterDepId + 77 | ", afterJobId=" + afterJobId + 78 | ", removeDate=" + removeDate + 79 | ", reason='" + reason + '\'' + 80 | ", remark='" + remark + '\'' + 81 | '}'; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vuehr/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vuehr", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "江南一点雨 ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "axios": "^0.18.0", 14 | "element-ui": "^2.4.5", 15 | "font-awesome": "^4.7.0", 16 | "vue": "^2.5.2", 17 | "vue-router": "^3.0.1", 18 | "vue-stomp": "0.0.5", 19 | "vuex": "^3.0.1" 20 | }, 21 | "devDependencies": { 22 | "autoprefixer": "^7.1.2", 23 | "babel-core": "^6.22.1", 24 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 25 | "babel-loader": "^7.1.1", 26 | "babel-plugin-syntax-jsx": "^6.18.0", 27 | "babel-plugin-transform-runtime": "^6.22.0", 28 | "babel-plugin-transform-vue-jsx": "^3.5.0", 29 | "babel-preset-env": "^1.3.2", 30 | "babel-preset-stage-2": "^6.22.0", 31 | "chalk": "^2.0.1", 32 | "copy-webpack-plugin": "^4.0.1", 33 | "css-loader": "^0.28.0", 34 | "extract-text-webpack-plugin": "^3.0.0", 35 | "file-loader": "^1.1.4", 36 | "friendly-errors-webpack-plugin": "^1.6.1", 37 | "html-webpack-plugin": "^2.30.1", 38 | "node-notifier": "^5.1.2", 39 | "optimize-css-assets-webpack-plugin": "^3.2.0", 40 | "ora": "^1.2.0", 41 | "portfinder": "^1.0.13", 42 | "postcss-import": "^11.0.0", 43 | "postcss-loader": "^2.0.8", 44 | "rimraf": "^2.6.0", 45 | "semver": "^5.3.0", 46 | "shelljs": "^0.7.6", 47 | "uglifyjs-webpack-plugin": "^1.1.1", 48 | "url-loader": "^0.5.8", 49 | "vue-loader": "^13.3.0", 50 | "vue-style-loader": "^3.0.1", 51 | "vue-template-compiler": "^2.5.2", 52 | "webpack": "^3.6.0", 53 | "webpack-bundle-analyzer": "^2.9.0", 54 | "webpack-dev-server": "^2.9.1", 55 | "webpack-merge": "^4.1.0" 56 | }, 57 | "engines": { 58 | "node": ">= 4.0.0", 59 | "npm": ">= 3.0.0" 60 | }, 61 | "browserslist": [ 62 | "> 1%", 63 | "last 2 versions", 64 | "not ie <= 8" 65 | ] 66 | } 67 | -------------------------------------------------------------------------------- /vuehr/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Login from '@/components/Login' 4 | import Home from '@/components/Home' 5 | import Chat from '@/components/chat/Chat' 6 | // import EmpAdv from '@/components/emp/EmpAdv' 7 | // import EmpBasic from '@/components/emp/EmpBasic' 8 | // import PerEc from '@/components/personnel/PerEc' 9 | // import PerEmp from '@/components/personnel/PerEmp' 10 | // import PerMv from '@/components/personnel/PerMv' 11 | // import PerSalary from '@/components/personnel/PerSalary' 12 | // import PerTrain from '@/components/personnel/PerTrain' 13 | // import SalMonth from '@/components/salary/SalMonth' 14 | // import SalSearch from '@/components/salary/SalSearch' 15 | // import SalSob from '@/components/salary/SalSob' 16 | // import SalSobCfg from '@/components/salary/SalSobCfg' 17 | // import SalTable from '@/components/salary/SalTable' 18 | // import StaAll from '@/components/statistics/StaAll' 19 | // import StaPers from '@/components/statistics/StaPers' 20 | // import StaRecord from '@/components/statistics/StaRecord' 21 | // import StaScore from '@/components/statistics/StaScore' 22 | // import SysBasic from '@/components/system/SysBasic' 23 | // import SysCfg from '@/components/system/SysCfg' 24 | // import SysData from '@/components/system/SysData' 25 | // import SysHr from '@/components/system/SysHr' 26 | // import SysInit from '@/components/system/SysInit' 27 | // import SysLog from '@/components/system/SysLog' 28 | 29 | Vue.use(Router) 30 | 31 | export default new Router({ 32 | routes: [ 33 | { 34 | path: '/', 35 | name: 'Login', 36 | component: Login, 37 | hidden: true 38 | }, { 39 | path: '/home', 40 | name: '主页', 41 | component: Home, 42 | hidden: true, 43 | meta: { 44 | requireAuth: true 45 | }, 46 | children: [ 47 | { 48 | path: '/chat', 49 | name: '消息', 50 | component: Chat, 51 | hidden: true, 52 | meta: { 53 | keepAlive: false, 54 | requireAuth: true 55 | } 56 | } 57 | ] 58 | } 59 | ] 60 | }) 61 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/AdjustSalary.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class AdjustSalary { 6 | 7 | private Long id; 8 | private Long eid; 9 | private Date asDate; 10 | private Integer beforeSalary; 11 | private Integer afterSalary; 12 | private String reason; 13 | private String remark; 14 | 15 | public Long getId() { 16 | return id; 17 | } 18 | 19 | public void setId(Long id) { 20 | this.id = id; 21 | } 22 | 23 | public Long getEid() { 24 | return eid; 25 | } 26 | 27 | public void setEid(Long eid) { 28 | this.eid = eid; 29 | } 30 | 31 | public Date getAsDate() { 32 | return asDate; 33 | } 34 | 35 | public void setAsDate(Date asDate) { 36 | this.asDate = asDate; 37 | } 38 | 39 | public Integer getBeforeSalary() { 40 | return beforeSalary; 41 | } 42 | 43 | public void setBeforeSalary(Integer beforeSalary) { 44 | this.beforeSalary = beforeSalary; 45 | } 46 | 47 | public Integer getAfterSalary() { 48 | return afterSalary; 49 | } 50 | 51 | public void setAfterSalary(Integer afterSalary) { 52 | this.afterSalary = afterSalary; 53 | } 54 | 55 | public String getReason() { 56 | return reason; 57 | } 58 | 59 | public void setReason(String reason) { 60 | this.reason = reason; 61 | } 62 | 63 | public String getRemark() { 64 | return remark; 65 | } 66 | 67 | public void setRemark(String remark) { 68 | this.remark = remark; 69 | } 70 | 71 | @Override 72 | public String toString() { 73 | return "AdjustSalary{" + 74 | "id=" + id + 75 | ", eid=" + eid + 76 | ", asDate=" + asDate + 77 | ", beforeSalary=" + beforeSalary + 78 | ", afterSalary=" + afterSalary + 79 | ", reason='" + reason + '\'' + 80 | ", remark='" + remark + '\'' + 81 | '}'; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/config/UrlAccessDecisionManager.java: -------------------------------------------------------------------------------- 1 | package org.sang.config; 2 | 3 | import org.springframework.security.access.AccessDecisionManager; 4 | import org.springframework.security.access.AccessDeniedException; 5 | import org.springframework.security.access.ConfigAttribute; 6 | import org.springframework.security.authentication.AnonymousAuthenticationToken; 7 | import org.springframework.security.authentication.BadCredentialsException; 8 | import org.springframework.security.core.Authentication; 9 | import org.springframework.security.core.AuthenticationException; 10 | import org.springframework.security.core.GrantedAuthority; 11 | import org.springframework.stereotype.Component; 12 | 13 | import java.util.Collection; 14 | import java.util.Iterator; 15 | 16 | /** 17 | * Created by sang on 2017/12/28. 18 | */ 19 | @Component 20 | public class UrlAccessDecisionManager implements AccessDecisionManager { 21 | @Override 22 | public void decide(Authentication auth, Object o, Collection cas){ 23 | Iterator iterator = cas.iterator(); 24 | while (iterator.hasNext()) { 25 | ConfigAttribute ca = iterator.next(); 26 | //当前请求需要的权限 27 | String needRole = ca.getAttribute(); 28 | if ("ROLE_LOGIN".equals(needRole)) { 29 | if (auth instanceof AnonymousAuthenticationToken) { 30 | throw new BadCredentialsException("未登录"); 31 | } else 32 | return; 33 | } 34 | //当前用户所具有的权限 35 | Collection authorities = auth.getAuthorities(); 36 | for (GrantedAuthority authority : authorities) { 37 | if (authority.getAuthority().equals(needRole)) { 38 | return; 39 | } 40 | } 41 | } 42 | throw new AccessDeniedException("权限不足!"); 43 | } 44 | @Override 45 | public boolean supports(ConfigAttribute configAttribute) { 46 | return true; 47 | } 48 | @Override 49 | public boolean supports(Class aClass) { 50 | return true; 51 | } 52 | } -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/salary/SalaryTableController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.salary; 2 | 3 | import org.sang.bean.Department; 4 | import org.sang.bean.Employee; 5 | import org.sang.bean.SalaryMan; 6 | import org.sang.service.DepartmentService; 7 | import org.sang.service.EmpService; 8 | import org.sang.service.SalaryService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestParam; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import java.util.HashMap; 15 | import java.util.LinkedList; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | /** 20 | * Created by sang on 2018/1/26. 21 | */ 22 | @RestController 23 | @RequestMapping("/salary/table") 24 | public class SalaryTableController { 25 | 26 | @Autowired 27 | SalaryService salaryService; 28 | @Autowired 29 | EmpService empService; 30 | 31 | @RequestMapping("/man") 32 | public Map getEmployeeByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size){ 33 | 34 | Map map = new HashMap<>(); 35 | List employeeByPage = empService.getEmployeeByPageShort(page, size); 36 | Long count = empService.getCountByKeywords("", null, null, null, null, null, null, null); 37 | 38 | List salaryManList=new LinkedList<>(); 39 | for (Employee employee:employeeByPage){ 40 | 41 | SalaryMan salaryMan=new SalaryMan(); 42 | salaryMan.setName(employee.getName()); 43 | salaryMan.setWorkID(employee.getWorkID()); 44 | salaryMan.setLateCount(salaryService.getLateCount(employee.getId())); 45 | salaryMan.setLeaveCount(salaryService.getLeaveCount(employee.getId())); 46 | salaryMan.setOvertime(salaryService.getOvertime(employee.getId())); 47 | salaryManList.add(salaryMan); 48 | } 49 | 50 | 51 | map.put("salaries",salaryManList); 52 | map.put("count",count); 53 | return map; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/personnel/EmpTrainController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.personnel; 2 | 3 | import org.sang.bean.EmpTrain; 4 | import org.sang.bean.Employee; 5 | import org.sang.bean.RespBean; 6 | import org.sang.common.DateConverter; 7 | import org.sang.service.EmpService; 8 | import org.sang.service.PersonnelService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | import java.text.ParseException; 16 | import java.text.SimpleDateFormat; 17 | import java.util.Date; 18 | import java.util.List; 19 | 20 | @RestController 21 | @RequestMapping("/personnel/train") 22 | public class EmpTrainController { 23 | 24 | @Autowired 25 | PersonnelService personnelService; 26 | 27 | @Autowired 28 | EmpService empService; 29 | 30 | @RequestMapping(value = "/trains", method = RequestMethod.POST) 31 | public RespBean addEmpTrain(EmpTrain empTrain){ 32 | if(personnelService.addEmpTrain(empTrain)==1){ 33 | return RespBean.ok("添加成功"); 34 | } 35 | return RespBean.error("添加失败"); 36 | } 37 | 38 | @RequestMapping(value = "/trains", method = RequestMethod.GET) 39 | public List getAllTrains(){ 40 | return personnelService.getAllEmpTrains(); 41 | } 42 | 43 | @RequestMapping(value = "/trains", method = RequestMethod.PUT) 44 | public RespBean updateEmpTrain(EmpTrain empTrain){ 45 | if(personnelService.updateEmpTrain(empTrain)==1){ 46 | return RespBean.ok("修改成功"); 47 | } 48 | return RespBean.error("修改失败"); 49 | } 50 | @RequestMapping(value = "/trains/{ids}", method = RequestMethod.DELETE) 51 | public RespBean deleteEmpTrain(@PathVariable String ids){ 52 | if(personnelService.deleteEmpTrain(ids)>=1){ 53 | return RespBean.ok("删除成功"); 54 | } 55 | return RespBean.error("删除失败"); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/ChatController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller; 2 | 3 | import org.sang.bean.Hr; 4 | import org.sang.bean.MsgContent; 5 | import org.sang.bean.RespBean; 6 | import org.sang.bean.SysMsg; 7 | import org.sang.service.HrService; 8 | import org.sang.service.SysMsgService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * 处理通知消息的Controller 19 | * 登录即可访问 20 | */ 21 | @RestController 22 | @RequestMapping("/chat") 23 | public class ChatController { 24 | @Autowired 25 | HrService hrService; 26 | @Autowired 27 | SysMsgService sysMsgService; 28 | 29 | @RequestMapping(value = "/hrs", method = RequestMethod.GET) 30 | public List
getAllHr() { 31 | return hrService.getAllHrExceptAdmin(); 32 | } 33 | 34 | @RequestMapping(value = "/nf", method = RequestMethod.POST) 35 | public RespBean sendNf(MsgContent msg) { 36 | if (sysMsgService.sendMsg(msg)) { 37 | return RespBean.ok("发送成功!"); 38 | } 39 | return RespBean.error("发送失败!"); 40 | } 41 | 42 | @RequestMapping("/sysmsgs") 43 | public List getSysMsg(@RequestParam(value = "page", defaultValue = "1") Integer page, @RequestParam(value = "size", defaultValue = "10") Integer size) { 44 | return sysMsgService.getSysMsgByPage(page, size); 45 | } 46 | 47 | @RequestMapping(value = "/markread", method = RequestMethod.PUT) 48 | public RespBean markRead(Long flag) { 49 | if (sysMsgService.markRead(flag)) { 50 | if (flag == -1) { 51 | return RespBean.ok("multiple"); 52 | } else { 53 | return RespBean.ok("single"); 54 | } 55 | } else { 56 | if (flag == -1) { 57 | return RespBean.error("multiple"); 58 | } else { 59 | return RespBean.error("single"); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vuehr/src/utils/utils.js: -------------------------------------------------------------------------------- 1 | import {getRequest} from './api' 2 | import {Message} from 'element-ui' 3 | 4 | export const isNotNullORBlank = (...args)=> { 5 | for (var i = 0; i < args.length; i++) { 6 | var argument = args[i]; 7 | if (argument == null || argument == '' || argument == undefined) { 8 | Message.warning({message: '数据不能为空!'}) 9 | return false; 10 | } 11 | } 12 | return true; 13 | } 14 | export const initMenu = (router, store)=> { 15 | if (store.state.routes.length > 0) { 16 | return; 17 | } 18 | getRequest("/config/sysmenu").then(resp=> { 19 | if (resp && resp.status == 200) { 20 | var fmtRoutes = formatRoutes(resp.data); 21 | router.addRoutes(fmtRoutes); 22 | store.commit('initMenu', fmtRoutes); 23 | store.dispatch('connect'); 24 | } 25 | }) 26 | } 27 | export const formatRoutes = (routes)=> { 28 | let fmRoutes = []; 29 | routes.forEach(router=> { 30 | let { 31 | path, 32 | component, 33 | name, 34 | meta, 35 | iconCls, 36 | children 37 | } = router; 38 | if (children && children instanceof Array) { 39 | children = formatRoutes(children); 40 | } 41 | let fmRouter = { 42 | path: path, 43 | component(resolve){ 44 | if (component.startsWith("Home")) { 45 | require(['../components/' + component + '.vue'], resolve) 46 | } else if (component.startsWith("Emp")) { 47 | require(['../components/emp/' + component + '.vue'], resolve) 48 | } else if (component.startsWith("Per")) { 49 | require(['../components/personnel/' + component + '.vue'], resolve) 50 | } else if (component.startsWith("Sal")) { 51 | require(['../components/salary/' + component + '.vue'], resolve) 52 | } else if (component.startsWith("Sta")) { 53 | require(['../components/statistics/' + component + '.vue'], resolve) 54 | } else if (component.startsWith("Sys")) { 55 | require(['../components/system/' + component + '.vue'], resolve) 56 | } 57 | }, 58 | name: name, 59 | iconCls: iconCls, 60 | meta: meta, 61 | children: children 62 | }; 63 | fmRoutes.push(fmRouter); 64 | }) 65 | return fmRoutes; 66 | } 67 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/common/EmailRunnable.java: -------------------------------------------------------------------------------- 1 | package org.sang.common; 2 | 3 | import org.sang.bean.Employee; 4 | import org.springframework.mail.javamail.JavaMailSender; 5 | import org.springframework.mail.javamail.MimeMessageHelper; 6 | import org.springframework.messaging.MessagingException; 7 | import org.thymeleaf.TemplateEngine; 8 | import org.thymeleaf.context.Context; 9 | 10 | import javax.mail.internet.MimeMessage; 11 | 12 | /** 13 | * Created by sang on 2017/9/20. 14 | */ 15 | public class EmailRunnable implements Runnable { 16 | private Employee employee; 17 | private JavaMailSender javaMailSender; 18 | private TemplateEngine templateEngine; 19 | 20 | public EmailRunnable(Employee employee, 21 | JavaMailSender javaMailSender, 22 | TemplateEngine templateEngine) { 23 | this.employee = employee; 24 | this.javaMailSender = javaMailSender; 25 | this.templateEngine = templateEngine; 26 | } 27 | @Override 28 | public void run() { 29 | try { 30 | MimeMessage message = javaMailSender.createMimeMessage(); 31 | MimeMessageHelper helper = new MimeMessageHelper(message, true); 32 | helper.setTo(employee.getEmail()); 33 | helper.setFrom("1510161612@qq.com"); 34 | helper.setSubject("XXX集团:通知"); 35 | Context ctx = new Context(); 36 | ctx.setVariable("name", employee.getName()); 37 | ctx.setVariable("workID", employee.getWorkID()); 38 | ctx.setVariable("contractTerm", employee.getContractTerm()); 39 | ctx.setVariable("beginContract", employee.getBeginContract()); 40 | ctx.setVariable("endContract", employee.getEndContract()); 41 | ctx.setVariable("departmentName", employee.getDepartmentName()); 42 | ctx.setVariable("posName", employee.getPosName()); 43 | String mail = templateEngine.process("email.html", ctx); 44 | helper.setText(mail, true); 45 | javaMailSender.send(message); 46 | } catch (MessagingException e) { 47 | System.out.println("发送失败"); 48 | } catch (javax.mail.MessagingException e) { 49 | e.printStackTrace(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vuehr/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | 12 | 13 | module.exports = { 14 | context: path.resolve(__dirname, '../'), 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | filename: '[name].js', 21 | publicPath: process.env.NODE_ENV === 'production' 22 | ? config.build.assetsPublicPath 23 | : config.dev.assetsPublicPath 24 | }, 25 | resolve: { 26 | extensions: ['.js', '.vue', '.json'], 27 | alias: { 28 | 'vue$': 'vue/dist/vue.esm.js', 29 | '@': resolve('src'), 30 | } 31 | }, 32 | module: { 33 | rules: [ 34 | { 35 | test: /\.vue$/, 36 | loader: 'vue-loader', 37 | options: vueLoaderConfig 38 | }, 39 | { 40 | test: /\.js$/, 41 | loader: 'babel-loader', 42 | include: [resolve('src'), resolve('test')] 43 | }, 44 | { 45 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 46 | loader: 'url-loader', 47 | options: { 48 | limit: 10000, 49 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 50 | } 51 | }, 52 | { 53 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 54 | loader: 'url-loader', 55 | options: { 56 | limit: 10000, 57 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 58 | } 59 | }, 60 | { 61 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 62 | loader: 'url-loader', 63 | options: { 64 | limit: 10000, 65 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 66 | } 67 | } 68 | ] 69 | }, 70 | node: { 71 | // prevent webpack from injecting useless setImmediate polyfill because Vue 72 | // source contains it (although only uses it if it's native). 73 | setImmediate: false, 74 | // prevent webpack from injecting mocks to Node native modules 75 | // that does not make sense for the client 76 | dgram: 'empty', 77 | fs: 'empty', 78 | net: 'empty', 79 | tls: 'empty', 80 | child_process: 'empty' 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/salary/SalarySearchController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.salary; 2 | 3 | 4 | import org.sang.bean.Employee; 5 | import org.sang.bean.SalSearch; 6 | import org.sang.bean.Salary; 7 | import org.sang.service.EmpService; 8 | import org.sang.service.SalaryService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | import java.util.HashMap; 16 | import java.util.LinkedList; 17 | import java.util.List; 18 | import java.util.Map; 19 | 20 | @RestController 21 | @RequestMapping("/salary/search") 22 | public class SalarySearchController { 23 | 24 | @Autowired 25 | SalaryService salaryService; 26 | 27 | @Autowired 28 | EmpService empService; 29 | 30 | @RequestMapping(value = "/all",method = RequestMethod.GET) 31 | public Map getSalaryByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size){ 32 | 33 | Map map = new HashMap<>(); 34 | List employeeByPage = empService.getEmployeeByPageShort(page, size); 35 | Long count = empService.getCountByKeywords("", null, null, null, null, null, null, null); 36 | 37 | List salSearches=new LinkedList<>(); 38 | 39 | for(Employee employee:employeeByPage){ 40 | SalSearch salSearch=new SalSearch(); 41 | Salary salary=salaryService.getSalaryById(employee.getId()); 42 | salSearch.setName(employee.getName()); 43 | salSearch.setWorkID(employee.getWorkID()); 44 | salSearch.setBonus(salaryService.getOvertime(employee.getId())*100); 45 | salSearch.setFine(salaryService.getLateCount(employee.getId())*50); 46 | salSearch.setPayment(salary.getBasicSalary()+salary.getBonus()+salary.getLunchSalary()+salary.getTrafficSalary()+salaryService.getOvertime(employee.getId())*100-salaryService.getLateCount(employee.getId())*50); 47 | salSearches.add(salSearch); 48 | } 49 | 50 | map.put("salaries",salSearches); 51 | map.put("count",count); 52 | return map; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/HrService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.Hr; 4 | import org.sang.common.HrUtils; 5 | import org.sang.mapper.HrMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.security.core.userdetails.UserDetails; 8 | import org.springframework.security.core.userdetails.UserDetailsService; 9 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 10 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 11 | import org.springframework.stereotype.Service; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * Created by sang on 2017/12/28. 18 | */ 19 | @Service 20 | @Transactional 21 | public class HrService implements UserDetailsService { 22 | 23 | @Autowired 24 | HrMapper hrMapper; 25 | 26 | @Override 27 | public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { 28 | Hr hr = hrMapper.loadUserByUsername(s); 29 | if (hr == null) { 30 | throw new UsernameNotFoundException("用户名不对"); 31 | } 32 | return hr; 33 | } 34 | 35 | public int hrReg(String username, String password) { 36 | //如果用户名存在,返回错误 37 | if (hrMapper.loadUserByUsername(username) != null) { 38 | return -1; 39 | } 40 | BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); 41 | String encode = encoder.encode(password); 42 | return hrMapper.hrReg(username, encode); 43 | } 44 | 45 | public List
getHrsByKeywords(String keywords) { 46 | return hrMapper.getHrsByKeywords(keywords); 47 | } 48 | 49 | public int updateHr(Hr hr) { 50 | return hrMapper.updateHr(hr); 51 | } 52 | 53 | public int updateHrRoles(Long hrId, Long[] rids) { 54 | int i = hrMapper.deleteRoleByHrId(hrId); 55 | return hrMapper.addRolesForHr(hrId, rids); 56 | } 57 | 58 | public Hr getHrById(Long hrId) { 59 | return hrMapper.getHrById(hrId); 60 | } 61 | 62 | public int deleteHr(Long hrId) { 63 | return hrMapper.deleteHr(hrId); 64 | } 65 | 66 | public List
getAllHrExceptAdmin() { 67 | return hrMapper.getAllHr(HrUtils.getCurrentHr().getId()); 68 | } 69 | public List
getAllHr() { 70 | return hrMapper.getAllHr(null); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/system/SystemHrController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.system; 2 | 3 | import org.sang.bean.Hr; 4 | import org.sang.bean.RespBean; 5 | import org.sang.service.HrService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Created by sang on 2018/1/2. 16 | */ 17 | @RestController 18 | @RequestMapping("/system/hr") 19 | public class SystemHrController { 20 | @Autowired 21 | HrService hrService; 22 | 23 | @RequestMapping("/id/{hrId}") 24 | public Hr getHrById(@PathVariable Long hrId) { 25 | return hrService.getHrById(hrId); 26 | } 27 | 28 | @RequestMapping(value = "/{hrId}", method = RequestMethod.DELETE) 29 | public RespBean deleteHr(@PathVariable Long hrId) { 30 | if (hrService.deleteHr(hrId) == 1) { 31 | return RespBean.ok("删除成功!"); 32 | } 33 | return RespBean.error("删除失败!"); 34 | } 35 | 36 | @RequestMapping(value = "/", method = RequestMethod.PUT) 37 | public RespBean updateHr(Hr hr) { 38 | if (hrService.updateHr(hr) == 1) { 39 | return RespBean.ok("更新成功!"); 40 | } 41 | return RespBean.error("更新失败!"); 42 | } 43 | 44 | @RequestMapping(value = "/roles", method = RequestMethod.PUT) 45 | public RespBean updateHrRoles(Long hrId, Long[] rids) { 46 | if (hrService.updateHrRoles(hrId, rids) == rids.length) { 47 | return RespBean.ok("更新成功!"); 48 | } 49 | return RespBean.error("更新失败!"); 50 | } 51 | 52 | @RequestMapping("/{keywords}") 53 | public List
getHrsByKeywords(@PathVariable(required = false) String keywords) { 54 | List
hrs = hrService.getHrsByKeywords(keywords); 55 | return hrs; 56 | } 57 | 58 | 59 | @RequestMapping(value = "/hr/reg", method = RequestMethod.POST) 60 | public RespBean hrReg(String username, String password) { 61 | int i = hrService.hrReg(username, password); 62 | if (i == 1) { 63 | return RespBean.ok("注册成功!"); 64 | } else if (i == -1) { 65 | return RespBean.error("用户名重复,注册失败!"); 66 | } 67 | return RespBean.error("注册失败!"); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /vuehr/src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 20 | 57 | 78 | -------------------------------------------------------------------------------- /vuehr/src/utils/api.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import {Message} from 'element-ui' 3 | axios.interceptors.request.use(config => { 4 | return config; 5 | }, err => { 6 | Message.error({message: '请求超时!'}); 7 | // return Promise.resolve(err); 8 | }) 9 | axios.interceptors.response.use(data => { 10 | if (data.status && data.status == 200 && data.data.status == 500) { 11 | Message.error({message: data.data.msg}); 12 | return; 13 | } 14 | if (data.data.msg) { 15 | Message.success({message: data.data.msg}); 16 | } 17 | return data; 18 | }, err => { 19 | if (err.response.status == 504 || err.response.status == 404) { 20 | Message.error({message: '服务器被吃了⊙﹏⊙∥'}); 21 | } else if (err.response.status == 403) { 22 | Message.error({message: '权限不足,请联系管理员!'}); 23 | } else if (err.response.status == 401) { 24 | Message.error({message: err.response.data.msg}); 25 | } else { 26 | if (err.response.data.msg) { 27 | Message.error({message: err.response.data.msg}); 28 | }else{ 29 | Message.error({message: '未知错误!'}); 30 | } 31 | } 32 | // return Promise.resolve(err); 33 | }) 34 | let base = ''; 35 | export const postRequest = (url, params) => { 36 | return axios({ 37 | method: 'post', 38 | url: `${base}${url}`, 39 | data: params, 40 | transformRequest: [function (data) { 41 | let ret = '' 42 | for (let it in data) { 43 | ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' 44 | } 45 | return ret 46 | }], 47 | headers: { 48 | 'Content-Type': 'application/x-www-form-urlencoded' 49 | } 50 | }); 51 | } 52 | export const uploadFileRequest = (url, params) => { 53 | return axios({ 54 | method: 'post', 55 | url: `${base}${url}`, 56 | data: params, 57 | headers: { 58 | 'Content-Type': 'multipart/form-data' 59 | } 60 | }); 61 | } 62 | export const putRequest = (url, params) => { 63 | return axios({ 64 | method: 'put', 65 | url: `${base}${url}`, 66 | data: params, 67 | transformRequest: [function (data) { 68 | let ret = '' 69 | for (let it in data) { 70 | ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' 71 | } 72 | return ret 73 | }], 74 | headers: { 75 | 'Content-Type': 'application/x-www-form-urlencoded' 76 | } 77 | }); 78 | } 79 | export const deleteRequest = (url) => { 80 | return axios({ 81 | method: 'delete', 82 | url: `${base}${url}` 83 | }); 84 | } 85 | export const getRequest = (url) => { 86 | return axios({ 87 | method: 'get', 88 | url: `${base}${url}` 89 | }); 90 | } 91 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Menu.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.annotation.JsonIgnore; 5 | 6 | import java.io.Serializable; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by sang on 2017/12/28. 11 | */ 12 | public class Menu implements Serializable { 13 | private Long id; 14 | private String url; 15 | private String path; 16 | private Object component; 17 | private String name; 18 | private String iconCls; 19 | private Long parentId; 20 | private List roles; 21 | private List children; 22 | private MenuMeta meta; 23 | 24 | public MenuMeta getMeta() { 25 | return meta; 26 | } 27 | 28 | public void setMeta(MenuMeta meta) { 29 | this.meta = meta; 30 | } 31 | 32 | public List getChildren() { 33 | return children; 34 | } 35 | 36 | public void setChildren(List children) { 37 | this.children = children; 38 | } 39 | 40 | public Long getId() { 41 | return id; 42 | } 43 | 44 | public void setId(Long id) { 45 | this.id = id; 46 | } 47 | 48 | @JsonIgnore 49 | public String getUrl() { 50 | return url; 51 | } 52 | 53 | public void setUrl(String url) { 54 | this.url = url; 55 | } 56 | 57 | public String getPath() { 58 | return path; 59 | } 60 | 61 | public void setPath(String path) { 62 | this.path = path; 63 | } 64 | 65 | @JsonFormat(shape = JsonFormat.Shape.OBJECT) 66 | public Object getComponent() { 67 | return component; 68 | } 69 | 70 | public void setComponent(Object component) { 71 | this.component = component; 72 | } 73 | 74 | public String getName() { 75 | return name; 76 | } 77 | 78 | public void setName(String name) { 79 | this.name = name; 80 | } 81 | 82 | public String getIconCls() { 83 | return iconCls; 84 | } 85 | 86 | public void setIconCls(String iconCls) { 87 | this.iconCls = iconCls; 88 | } 89 | 90 | @JsonIgnore 91 | public Long getParentId() { 92 | return parentId; 93 | } 94 | 95 | public void setParentId(Long parentId) { 96 | this.parentId = parentId; 97 | } 98 | 99 | @JsonIgnore 100 | public List getRoles() { 101 | return roles; 102 | } 103 | 104 | public void setRoles(List roles) { 105 | this.roles = roles; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Department.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * Created by sang on 2018/1/7. 10 | */ 11 | public class Department { 12 | private Long id; 13 | private String name; 14 | private Long parentId; 15 | private String depPath; 16 | private boolean enabled; 17 | private boolean isParent; 18 | 19 | public Department() { 20 | } 21 | 22 | public Department(String name) { 23 | this.name = name; 24 | } 25 | 26 | @Override 27 | public boolean equals(Object o) { 28 | if (this == o) return true; 29 | if (o == null || getClass() != o.getClass()) return false; 30 | 31 | Department that = (Department) o; 32 | 33 | return name != null ? name.equals(that.name) : that.name == null; 34 | } 35 | 36 | @Override 37 | public int hashCode() { 38 | return name != null ? name.hashCode() : 0; 39 | } 40 | 41 | //存储过程执行结果 42 | private Integer result; 43 | private List children = new ArrayList<>(); 44 | 45 | public List getChildren() { 46 | return children; 47 | } 48 | 49 | public void setChildren(List children) { 50 | this.children = children; 51 | } 52 | @JsonIgnore 53 | public Integer getResult() { 54 | return result; 55 | } 56 | 57 | public void setResult(Integer result) { 58 | this.result = result; 59 | } 60 | 61 | public Long getId() { 62 | return id; 63 | } 64 | 65 | public void setId(Long id) { 66 | this.id = id; 67 | } 68 | 69 | public String getName() { 70 | return name; 71 | } 72 | 73 | public void setName(String name) { 74 | this.name = name; 75 | } 76 | 77 | public Long getParentId() { 78 | return parentId; 79 | } 80 | 81 | public void setParentId(Long parentId) { 82 | this.parentId = parentId; 83 | } 84 | 85 | @JsonIgnore 86 | public String getDepPath() { 87 | return depPath; 88 | } 89 | 90 | public void setDepPath(String depPath) { 91 | this.depPath = depPath; 92 | } 93 | 94 | public boolean isEnabled() { 95 | return enabled; 96 | } 97 | 98 | public void setEnabled(boolean enabled) { 99 | this.enabled = enabled; 100 | } 101 | 102 | public boolean isParent() { 103 | return isParent; 104 | } 105 | 106 | public void setParent(boolean parent) { 107 | isParent = parent; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/PersonnelService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.AdjustSalary; 4 | import org.sang.bean.EmpEc; 5 | import org.sang.bean.EmpMove; 6 | import org.sang.bean.EmpTrain; 7 | import org.sang.mapper.PersonnelMapper; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import java.util.List; 13 | 14 | @Service 15 | @Transactional 16 | public class PersonnelService { 17 | 18 | @Autowired 19 | PersonnelMapper personnelMapper; 20 | 21 | 22 | public int addEc(EmpEc empEc){ 23 | return personnelMapper.addEc(empEc); 24 | } 25 | 26 | public List getAllEmpEc(){ 27 | return personnelMapper.getAllEmpEc(); 28 | } 29 | 30 | 31 | public int addEmpTrain(EmpTrain empTrain){ 32 | return personnelMapper.addEmpTrain(empTrain); 33 | } 34 | 35 | public int updateEmpTrain(EmpTrain empTrain){ 36 | return personnelMapper.updateEmpTrain(empTrain); 37 | } 38 | 39 | public int deleteEmpTrain(String ids){ 40 | String[] split=ids.split(","); 41 | return personnelMapper.deleteEmpTrain(split); 42 | } 43 | 44 | public List getAllEmpTrains(){ 45 | return personnelMapper.getAllEmpTrains(); 46 | } 47 | 48 | 49 | public int addAdjustSalary(AdjustSalary adjustSalary){ 50 | return personnelMapper.addAdjustSalary(adjustSalary); 51 | } 52 | 53 | public int updateAdjustSalary(AdjustSalary adjustSalary){ 54 | return personnelMapper.updateAdjustSalary(adjustSalary); 55 | } 56 | 57 | public int deleteAdjustSalary(String ids){ 58 | String[] split = ids.split(","); 59 | return personnelMapper.deleteAdjustSalary(split); 60 | } 61 | 62 | public List getAllAdjustSalary(){ 63 | return personnelMapper.getAllAdjustSalary(); 64 | } 65 | 66 | 67 | public int addEmpMove(EmpMove empMove){ 68 | return personnelMapper.addEmpMove(empMove); 69 | } 70 | 71 | public int updateEmpMove(EmpMove empMove){ 72 | return personnelMapper.updateEmpMove(empMove); 73 | } 74 | 75 | public int deleteEmpMove(String ids){ 76 | String[] split = ids.split(","); 77 | return personnelMapper.deleteEmpMove(split); 78 | } 79 | 80 | public List getAllEmpMove(){ 81 | return personnelMapper.getAllEmpMove(); 82 | } 83 | 84 | public int updateDepIdAndJobId(EmpMove empMove){ 85 | return personnelMapper.updateDepIdAndJobId(empMove); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vuehr/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.2.7 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: { 14 | '/': { 15 | target: 'http://localhost:8082', 16 | changeOrigin: true, 17 | pathRewrite: { 18 | '^/': '' 19 | } 20 | }, 21 | '/ws/*': { 22 | target: 'ws://127.0.0.1:8082', 23 | ws: true 24 | } 25 | }, 26 | 27 | // Various Dev Server settings 28 | host: 'localhost', // can be overwritten by process.env.HOST 29 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 30 | autoOpenBrowser: false, 31 | errorOverlay: true, 32 | notifyOnErrors: true, 33 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 34 | 35 | 36 | /** 37 | * Source Maps 38 | */ 39 | 40 | // https://webpack.js.org/configuration/devtool/#development 41 | devtool: 'eval-source-map', 42 | 43 | // If you have problems debugging vue-files in devtools, 44 | // set this to false - it *may* help 45 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 46 | cacheBusting: true, 47 | 48 | // CSS Sourcemaps off by default because relative paths are "buggy" 49 | // with this option, according to the CSS-Loader README 50 | // (https://github.com/webpack/css-loader#sourcemaps) 51 | // In our experience, they generally work as expected, 52 | // just be aware of this issue when enabling this option. 53 | cssSourceMap: false, 54 | }, 55 | 56 | build: { 57 | // Template for index.html 58 | index: path.resolve(__dirname, '../dist/index.html'), 59 | 60 | // Paths 61 | assetsRoot: path.resolve(__dirname, '../dist'), 62 | assetsSubDirectory: 'static', 63 | assetsPublicPath: '/', 64 | 65 | /** 66 | * Source Maps 67 | */ 68 | 69 | productionSourceMap: true, 70 | // https://webpack.js.org/configuration/devtool/#production 71 | devtool: '#source-map', 72 | 73 | // Gzip off by default as many popular static hosts such as 74 | // Surge or Netlify already gzip all static assets for you. 75 | // Before setting to `true`, make sure to: 76 | // npm install --save-dev compression-webpack-plugin 77 | productionGzip: false, 78 | productionGzipExtensions: ['js', 'css'], 79 | 80 | // Run the build command with an extra argument to 81 | // View the bundle analyzer report after build finishes: 82 | // `npm run build --report` 83 | // Set to `true` or `false` to always turn it on or off 84 | bundleAnalyzerReport: process.env.npm_config_report 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /vuehr/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const baseWebpackConfig = require('./webpack.base.conf') 7 | const HtmlWebpackPlugin = require('html-webpack-plugin') 8 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 9 | const portfinder = require('portfinder') 10 | 11 | const HOST = process.env.HOST 12 | const PORT = process.env.PORT && Number(process.env.PORT) 13 | 14 | const devWebpackConfig = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 17 | }, 18 | // cheap-module-eval-source-map is faster for development 19 | devtool: config.dev.devtool, 20 | 21 | // these devServer options should be customized in /config/index.js 22 | devServer: { 23 | clientLogLevel: 'warning', 24 | historyApiFallback: true, 25 | hot: true, 26 | compress: true, 27 | host: HOST || config.dev.host, 28 | port: PORT || config.dev.port, 29 | open: config.dev.autoOpenBrowser, 30 | overlay: config.dev.errorOverlay 31 | ? { warnings: false, errors: true } 32 | : false, 33 | publicPath: config.dev.assetsPublicPath, 34 | proxy: config.dev.proxyTable, 35 | quiet: true, // necessary for FriendlyErrorsPlugin 36 | watchOptions: { 37 | poll: config.dev.poll, 38 | } 39 | }, 40 | plugins: [ 41 | new webpack.DefinePlugin({ 42 | 'process.env': require('../config/dev.env') 43 | }), 44 | new webpack.HotModuleReplacementPlugin(), 45 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 46 | new webpack.NoEmitOnErrorsPlugin(), 47 | // https://github.com/ampedandwired/html-webpack-plugin 48 | new HtmlWebpackPlugin({ 49 | filename: 'index.html', 50 | template: 'index.html', 51 | inject: true 52 | }), 53 | ] 54 | }) 55 | 56 | module.exports = new Promise((resolve, reject) => { 57 | portfinder.basePort = process.env.PORT || config.dev.port 58 | portfinder.getPort((err, port) => { 59 | if (err) { 60 | reject(err) 61 | } else { 62 | // publish the new Port, necessary for e2e tests 63 | process.env.PORT = port 64 | // add port to devServer config 65 | devWebpackConfig.devServer.port = port 66 | 67 | // Add FriendlyErrorsPlugin 68 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 69 | compilationSuccessInfo: { 70 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], 71 | }, 72 | onErrors: config.dev.notifyOnErrors 73 | ? utils.createNotifierCallback() 74 | : undefined 75 | })) 76 | 77 | resolve(devWebpackConfig) 78 | } 79 | }) 80 | }) 81 | -------------------------------------------------------------------------------- /vuehr/build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const packageConfig = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | 12 | return path.posix.join(assetsSubDirectory, _path) 13 | } 14 | 15 | exports.cssLoaders = function (options) { 16 | options = options || {} 17 | 18 | const cssLoader = { 19 | loader: 'css-loader', 20 | options: { 21 | sourceMap: options.sourceMap 22 | } 23 | } 24 | 25 | const postcssLoader = { 26 | loader: 'postcss-loader', 27 | options: { 28 | sourceMap: options.sourceMap 29 | } 30 | } 31 | 32 | // generate loader string to be used with extract text plugin 33 | function generateLoaders (loader, loaderOptions) { 34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 35 | 36 | if (loader) { 37 | loaders.push({ 38 | loader: loader + '-loader', 39 | options: Object.assign({}, loaderOptions, { 40 | sourceMap: options.sourceMap 41 | }) 42 | }) 43 | } 44 | 45 | // Extract CSS when that option is specified 46 | // (which is the case during production build) 47 | if (options.extract) { 48 | return ExtractTextPlugin.extract({ 49 | use: loaders, 50 | fallback: 'vue-style-loader' 51 | }) 52 | } else { 53 | return ['vue-style-loader'].concat(loaders) 54 | } 55 | } 56 | 57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 58 | return { 59 | css: generateLoaders(), 60 | postcss: generateLoaders(), 61 | less: generateLoaders('less'), 62 | sass: generateLoaders('sass', { indentedSyntax: true }), 63 | scss: generateLoaders('sass'), 64 | stylus: generateLoaders('stylus'), 65 | styl: generateLoaders('stylus') 66 | } 67 | } 68 | 69 | // Generate loaders for standalone style files (outside of .vue) 70 | exports.styleLoaders = function (options) { 71 | const output = [] 72 | const loaders = exports.cssLoaders(options) 73 | 74 | for (const extension in loaders) { 75 | const loader = loaders[extension] 76 | output.push({ 77 | test: new RegExp('\\.' + extension + '$'), 78 | use: loader 79 | }) 80 | } 81 | 82 | return output 83 | } 84 | 85 | exports.createNotifierCallback = () => { 86 | const notifier = require('node-notifier') 87 | 88 | return (severity, errors) => { 89 | if (severity !== 'error') return 90 | 91 | const error = errors[0] 92 | const filename = error.file && error.file.split('!').pop() 93 | 94 | notifier.notify({ 95 | title: packageConfig.name, 96 | message: severity + ': ' + error.name, 97 | subtitle: filename || '', 98 | icon: path.join(__dirname, 'logo.png') 99 | }) 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /vuehr/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import '../lib/sockjs' 4 | import '../lib/stomp' 5 | 6 | Vue.use(Vuex) 7 | 8 | export default new Vuex.Store({ 9 | state: { 10 | user: { 11 | name: window.localStorage.getItem('user' || '[]') == null ? '未登录' : JSON.parse(window.localStorage.getItem('user' || '[]')).name, 12 | userface: window.localStorage.getItem('user' || '[]') == null ? '' : JSON.parse(window.localStorage.getItem('user' || '[]')).userface, 13 | username: window.localStorage.getItem('user' || '[]') == null ? '' : JSON.parse(window.localStorage.getItem('user' || '[]')).username, 14 | roles: window.localStorage.getItem('user' || '[]') == null ? '' : JSON.parse(window.localStorage.getItem('user' || '[]')).roles 15 | }, 16 | routes: [], 17 | msgList: [], 18 | isDotMap: new Map(), 19 | currentFriend: {}, 20 | stomp: null, 21 | nfDot: false 22 | }, 23 | mutations: { 24 | initMenu(state, menus){ 25 | state.routes = menus; 26 | }, 27 | login(state, user){ 28 | state.user = user; 29 | window.localStorage.setItem('user', JSON.stringify(user)); 30 | }, 31 | logout(state){ 32 | window.localStorage.removeItem('user'); 33 | state.routes = []; 34 | }, 35 | toggleNFDot(state, newValue){ 36 | state.nfDot = newValue; 37 | }, 38 | updateMsgList(state, newMsgList){ 39 | state.msgList = newMsgList; 40 | }, 41 | updateCurrentFriend(state, newFriend){ 42 | state.currentFriend = newFriend; 43 | }, 44 | addValue2DotMap(state, key){ 45 | state.isDotMap.set(key, "您有未读消息") 46 | }, 47 | removeValueDotMap(state, key){ 48 | state.isDotMap.delete(key); 49 | } 50 | }, 51 | actions: { 52 | connect(context){ 53 | context.state.stomp = Stomp.over(new SockJS("/ws/endpointChat")); 54 | context.state.stomp.connect({}, frame=> { 55 | context.state.stomp.subscribe("/user/queue/chat", message=> { 56 | var msg = JSON.parse(message.body); 57 | var oldMsg = window.localStorage.getItem(context.state.user.username + "#" + msg.from); 58 | if (oldMsg == null) { 59 | oldMsg = []; 60 | oldMsg.push(msg); 61 | window.localStorage.setItem(context.state.user.username + "#" + msg.from, JSON.stringify(oldMsg)) 62 | } else { 63 | var oldMsgJson = JSON.parse(oldMsg); 64 | oldMsgJson.push(msg); 65 | window.localStorage.setItem(context.state.user.username + "#" + msg.from, JSON.stringify(oldMsgJson)) 66 | } 67 | if (msg.from != context.state.currentFriend.username) { 68 | context.commit("addValue2DotMap", "isDot#" + context.state.user.username + "#" + msg.from); 69 | } 70 | //更新msgList 71 | var oldMsg2 = window.localStorage.getItem(context.state.user.username + "#" + context.state.currentFriend.username); 72 | if (oldMsg2 == null) { 73 | context.commit('updateMsgList', []); 74 | } else { 75 | context.commit('updateMsgList', JSON.parse(oldMsg2)); 76 | } 77 | }); 78 | context.state.stomp.subscribe("/topic/nf", message=> { 79 | context.commit('toggleNFDot', true); 80 | }); 81 | }, failedMsg=> { 82 | 83 | }); 84 | } 85 | } 86 | }); 87 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/statistics/PerStatisticsController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.statistics; 2 | 3 | 4 | import org.sang.bean.*; 5 | import org.sang.service.PersonnelService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestMethod; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import java.util.ArrayList; 12 | import java.util.LinkedList; 13 | import java.util.List; 14 | 15 | @RestController 16 | @RequestMapping("/statistics/recored") 17 | public class PerStatisticsController { 18 | 19 | @Autowired 20 | PersonnelService personnelService; 21 | 22 | @RequestMapping(value = "/personnel",method = RequestMethod.GET) 23 | public List getAllPer(){ 24 | 25 | List statisticsList=new LinkedList<>(); 26 | 27 | if(personnelService.getAllEmpEc()!=null){ 28 | List empEcs=new ArrayList<>(); 29 | empEcs=personnelService.getAllEmpEc(); 30 | for(EmpEc empEc:empEcs){ 31 | Statistics statistics=new Statistics(); 32 | statistics.setType("奖惩"); 33 | statistics.setEid(empEc.getEid()); 34 | statistics.setRemark(empEc.getRemark()); 35 | statistics.settDate(empEc.getEcDate()); 36 | statisticsList.add(statistics); 37 | } 38 | } 39 | 40 | if(personnelService.getAllAdjustSalary()!=null){ 41 | List adjustSalaries=new ArrayList<>(); 42 | adjustSalaries=personnelService.getAllAdjustSalary(); 43 | for (AdjustSalary adjustSalary:adjustSalaries){ 44 | Statistics statistics=new Statistics(); 45 | statistics.setType("调薪"); 46 | statistics.setEid(adjustSalary.getEid()); 47 | statistics.settDate(adjustSalary.getAsDate()); 48 | statistics.setRemark(adjustSalary.getRemark()); 49 | statisticsList.add(statistics); 50 | } 51 | } 52 | 53 | if(personnelService.getAllEmpMove()!=null){ 54 | List empMoves=new ArrayList<>(); 55 | empMoves=personnelService.getAllEmpMove(); 56 | for(EmpMove empMove:empMoves){ 57 | Statistics statistics=new Statistics(); 58 | statistics.setType("调动"); 59 | statistics.setEid(empMove.getEid()); 60 | statistics.setRemark(empMove.getRemark()); 61 | statistics.settDate(empMove.getRemoveDate()); 62 | statisticsList.add(statistics); 63 | } 64 | } 65 | 66 | if(personnelService.getAllEmpTrains()!=null){ 67 | List empTrains=new ArrayList<>(); 68 | empTrains=personnelService.getAllEmpTrains(); 69 | for(EmpTrain empTrain:empTrains){ 70 | Statistics statistics=new Statistics(); 71 | statistics.setType("培训"); 72 | statistics.settDate(empTrain.getTrainDate()); 73 | statistics.setRemark(empTrain.getRemark()); 74 | statistics.setEid(empTrain.getEid()); 75 | statisticsList.add(statistics); 76 | } 77 | } 78 | 79 | return statisticsList; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Salary.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import java.util.Date; 4 | 5 | public class Salary { 6 | private Integer id; 7 | private Integer bonus; 8 | private Integer lunchSalary; 9 | private Integer trafficSalary; 10 | private Integer basicSalary; 11 | private Integer allSalary; 12 | private Integer pensionBase; 13 | private Float pensionPer; 14 | private Date createDate; 15 | private Integer medicalBase; 16 | private Float medicalPer; 17 | private Integer accumulationFundBase; 18 | private Float accumulationFundPer; 19 | private String name; 20 | 21 | public Integer getId() { 22 | return id; 23 | } 24 | 25 | public void setId(Integer id) { 26 | this.id = id; 27 | } 28 | 29 | public Integer getBonus() { 30 | return bonus; 31 | } 32 | 33 | public void setBonus(Integer bonus) { 34 | this.bonus = bonus; 35 | } 36 | 37 | public Integer getLunchSalary() { 38 | return lunchSalary; 39 | } 40 | 41 | public void setLunchSalary(Integer lunchSalary) { 42 | this.lunchSalary = lunchSalary; 43 | } 44 | 45 | public Integer getTrafficSalary() { 46 | return trafficSalary; 47 | } 48 | 49 | public void setTrafficSalary(Integer trafficSalary) { 50 | this.trafficSalary = trafficSalary; 51 | } 52 | 53 | public Integer getBasicSalary() { 54 | return basicSalary; 55 | } 56 | 57 | public void setBasicSalary(Integer basicSalary) { 58 | this.basicSalary = basicSalary; 59 | } 60 | 61 | public Integer getAllSalary() { 62 | return allSalary; 63 | } 64 | 65 | public void setAllSalary(Integer allSalary) { 66 | this.allSalary = allSalary; 67 | } 68 | 69 | public Integer getPensionBase() { 70 | return pensionBase; 71 | } 72 | 73 | public void setPensionBase(Integer pensionBase) { 74 | this.pensionBase = pensionBase; 75 | } 76 | 77 | public Float getPensionPer() { 78 | return pensionPer; 79 | } 80 | 81 | public void setPensionPer(Float pensionPer) { 82 | this.pensionPer = pensionPer; 83 | } 84 | 85 | public Date getCreateDate() { 86 | return createDate; 87 | } 88 | 89 | public void setCreateDate(Date createDate) { 90 | this.createDate = createDate; 91 | } 92 | 93 | public Integer getMedicalBase() { 94 | return medicalBase; 95 | } 96 | 97 | public void setMedicalBase(Integer medicalBase) { 98 | this.medicalBase = medicalBase; 99 | } 100 | 101 | public Float getMedicalPer() { 102 | return medicalPer; 103 | } 104 | 105 | public void setMedicalPer(Float medicalPer) { 106 | this.medicalPer = medicalPer; 107 | } 108 | 109 | public Integer getAccumulationFundBase() { 110 | return accumulationFundBase; 111 | } 112 | 113 | public void setAccumulationFundBase(Integer accumulationFundBase) { 114 | this.accumulationFundBase = accumulationFundBase; 115 | } 116 | 117 | public Float getAccumulationFundPer() { 118 | return accumulationFundPer; 119 | } 120 | 121 | public void setAccumulationFundPer(Float accumulationFundPer) { 122 | this.accumulationFundPer = accumulationFundPer; 123 | } 124 | 125 | public String getName() { 126 | return name; 127 | } 128 | 129 | public void setName(String name) { 130 | this.name = name; 131 | } 132 | } -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/MenuMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 46 | 49 | 52 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/bean/Hr.java: -------------------------------------------------------------------------------- 1 | package org.sang.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import org.springframework.security.core.GrantedAuthority; 5 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collection; 10 | import java.util.List; 11 | 12 | /** 13 | * Created by sang on 2017/12/28. 14 | */ 15 | public class Hr implements UserDetails { 16 | private Long id; 17 | private String name; 18 | private String phone; 19 | private String telephone; 20 | private String address; 21 | private boolean enabled; 22 | private String username; 23 | private String password; 24 | private String remark; 25 | private List roles; 26 | private String userface; 27 | @Override 28 | public boolean isEnabled() { 29 | return enabled; 30 | } 31 | @Override 32 | public String getUsername() { 33 | return username; 34 | } 35 | @JsonIgnore 36 | @Override 37 | public boolean isAccountNonExpired() { 38 | return true; 39 | } 40 | @JsonIgnore 41 | @Override 42 | public boolean isAccountNonLocked() { 43 | return true; 44 | } 45 | @JsonIgnore 46 | @Override 47 | public boolean isCredentialsNonExpired() { 48 | return true; 49 | } 50 | @JsonIgnore 51 | @Override 52 | public Collection getAuthorities() { 53 | List authorities = new ArrayList<>(); 54 | for (Role role : roles) { 55 | authorities.add(new SimpleGrantedAuthority(role.getName())); 56 | } 57 | return authorities; 58 | } 59 | @JsonIgnore 60 | @Override 61 | public String getPassword() { 62 | return password; 63 | } 64 | 65 | public String getUserface() { 66 | return userface; 67 | } 68 | 69 | public void setUserface(String userface) { 70 | this.userface = userface; 71 | } 72 | 73 | public List getRoles() { 74 | return roles; 75 | } 76 | 77 | public void setRoles(List roles) { 78 | this.roles = roles; 79 | } 80 | 81 | public Long getId() { 82 | return id; 83 | } 84 | 85 | public void setId(Long id) { 86 | this.id = id; 87 | } 88 | 89 | public String getName() { 90 | return name; 91 | } 92 | 93 | public void setName(String name) { 94 | this.name = name; 95 | } 96 | 97 | public String getPhone() { 98 | return phone; 99 | } 100 | 101 | public void setPhone(String phone) { 102 | this.phone = phone; 103 | } 104 | 105 | public String getTelephone() { 106 | return telephone; 107 | } 108 | 109 | public void setTelephone(String telephone) { 110 | this.telephone = telephone; 111 | } 112 | 113 | public String getAddress() { 114 | return address; 115 | } 116 | 117 | public void setAddress(String address) { 118 | this.address = address; 119 | } 120 | 121 | public void setEnabled(boolean enabled) { 122 | this.enabled = enabled; 123 | } 124 | 125 | 126 | public void setUsername(String username) { 127 | this.username = username; 128 | } 129 | 130 | public void setPassword(String password) { 131 | this.password = password; 132 | } 133 | 134 | public String getRemark() { 135 | return remark; 136 | } 137 | 138 | public void setRemark(String remark) { 139 | this.remark = remark; 140 | } 141 | } -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/SalaryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | insert into salary (bonus, lunchSalary, 8 | trafficSalary, basicSalary, 9 | pensionBase, pensionPer, createDate, 10 | medicalBase, medicalPer, accumulationFundBase, 11 | accumulationFundPer, name) 12 | values (#{salary.bonus,jdbcType=INTEGER}, #{salary.lunchSalary,jdbcType=INTEGER}, 13 | #{salary.trafficSalary,jdbcType=INTEGER}, #{salary.basicSalary,jdbcType=INTEGER}, 14 | #{salary.pensionBase,jdbcType=INTEGER}, #{salary.pensionPer,jdbcType=REAL}, #{salary.createDate,jdbcType=TIMESTAMP}, 15 | #{salary.medicalBase,jdbcType=INTEGER}, #{salary.medicalPer,jdbcType=REAL}, #{salary.accumulationFundBase,jdbcType=INTEGER}, 16 | #{salary.accumulationFundPer,jdbcType=REAL}, #{salary.name,jdbcType=VARCHAR}) 17 | 18 | 21 | 22 | update salary 23 | 24 | 25 | bonus = #{salary.bonus,jdbcType=INTEGER}, 26 | 27 | 28 | lunchSalary = #{salary.lunchSalary,jdbcType=INTEGER}, 29 | 30 | 31 | trafficSalary = #{salary.trafficSalary,jdbcType=INTEGER}, 32 | 33 | 34 | basicSalary = #{salary.basicSalary,jdbcType=INTEGER}, 35 | 36 | 37 | allSalary = #{salary.allSalary,jdbcType=INTEGER}, 38 | 39 | 40 | pensionBase = #{salary.pensionBase,jdbcType=INTEGER}, 41 | 42 | 43 | pensionPer = #{salary.pensionPer,jdbcType=REAL}, 44 | 45 | 46 | createDate = #{salary.createDate,jdbcType=TIMESTAMP}, 47 | 48 | 49 | medicalBase = #{salary.medicalBase,jdbcType=INTEGER}, 50 | 51 | 52 | medicalPer = #{salary.medicalPer,jdbcType=REAL}, 53 | 54 | 55 | accumulationFundBase = #{salary.accumulationFundBase,jdbcType=INTEGER}, 56 | 57 | 58 | accumulationFundPer = #{salary.accumulationFundPer,jdbcType=REAL}, 59 | 60 | 61 | name = #{salary.name,jdbcType=VARCHAR}, 62 | 63 | 64 | where id = #{salary.id,jdbcType=INTEGER} 65 | 66 | 67 | DELETE FROM salary WHERE id IN 68 | 69 | #{id} 70 | 71 | 72 | 73 | DELETE FROM empsalary WHERE eid=#{eid} 74 | 75 | 76 | INSERT INTO empsalary set eid=#{eid},sid=#{sid} 77 | 78 | 79 | 83 | 84 | 88 | 89 | 93 | 94 | 98 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/mapper/HrMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 35 | 36 | INSERT INTO hr set username=#{username},password=#{password} 37 | 38 | 47 | 51 | 52 | update hr 53 | 54 | 55 | name = #{name,jdbcType=VARCHAR}, 56 | 57 | 58 | phone = #{phone,jdbcType=CHAR}, 59 | 60 | 61 | telephone = #{telephone,jdbcType=VARCHAR}, 62 | 63 | 64 | address = #{address,jdbcType=VARCHAR}, 65 | 66 | 67 | enabled = #{enabled,jdbcType=BIT}, 68 | 69 | 70 | username = #{username,jdbcType=VARCHAR}, 71 | 72 | 73 | password = #{password,jdbcType=VARCHAR}, 74 | 75 | 76 | userface = #{userface,jdbcType=VARCHAR}, 77 | 78 | 79 | remark = #{remark,jdbcType=VARCHAR}, 80 | 81 | 82 | where id = #{id} 83 | 84 | 85 | DELETE FROM hr_role where hrid=#{hrId} 86 | 87 | 88 | INSERT INTO hr_role(hrid,rid) VALUES 89 | 90 | (#{hrId},#{rid}) 91 | 92 | 93 | 94 | DELETE FROM hr WHERE id=#{hrId} 95 | 96 | 102 | -------------------------------------------------------------------------------- /hrserver/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.sang 7 | hrserver 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | hrserver 12 | Demo project for Spring Boot 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.4.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-tomcat 35 | 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-undertow 41 | 42 | 43 | org.mybatis.spring.boot 44 | mybatis-spring-boot-starter 45 | 1.3.2 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-starter-security 50 | 51 | 52 | org.springframework.boot 53 | spring-boot-starter-data-redis 54 | 55 | 56 | io.lettuce 57 | lettuce-core 58 | 59 | 60 | 61 | 62 | redis.clients 63 | jedis 64 | 65 | 66 | com.alibaba 67 | druid 68 | 1.1.10 69 | 70 | 71 | mysql 72 | mysql-connector-java 73 | 74 | 75 | org.apache.poi 76 | poi 77 | 3.17 78 | 79 | 80 | org.springframework.boot 81 | spring-boot-starter-mail 82 | 83 | 84 | org.springframework.boot 85 | spring-boot-starter-thymeleaf 86 | 87 | 88 | org.springframework.boot 89 | spring-boot-starter-websocket 90 | 91 | 92 | org.springframework.boot 93 | spring-boot-starter-cache 94 | 95 | 96 | org.springframework.boot 97 | spring-boot-starter-test 98 | test 99 | 100 | 101 | 102 | 103 | 104 | 105 | org.springframework.boot 106 | spring-boot-maven-plugin 107 | 108 | 109 | 110 | 111 | src/main/java 112 | 113 | **/*.xml 114 | 115 | 116 | 117 | src/main/resources 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /vuehr/src/components/personnel/PerEc.vue: -------------------------------------------------------------------------------- 1 | 85 | 138 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/service/EmpService.java: -------------------------------------------------------------------------------- 1 | package org.sang.service; 2 | 3 | import org.sang.bean.Employee; 4 | import org.sang.bean.Nation; 5 | import org.sang.bean.PoliticsStatus; 6 | import org.sang.mapper.EmpMapper; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import java.text.DecimalFormat; 12 | import java.text.ParseException; 13 | import java.text.SimpleDateFormat; 14 | import java.util.Date; 15 | import java.util.List; 16 | 17 | /** 18 | * Created by sang on 2018/1/12. 19 | */ 20 | @Service 21 | @Transactional 22 | public class EmpService { 23 | @Autowired 24 | EmpMapper empMapper; 25 | SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy"); 26 | SimpleDateFormat monthFormat = new SimpleDateFormat("MM"); 27 | SimpleDateFormat birthdayFormat = new SimpleDateFormat("yyyy-MM-dd"); 28 | DecimalFormat decimalFormat = new DecimalFormat("##.00"); 29 | 30 | public List getAllNations() { 31 | return empMapper.getAllNations(); 32 | } 33 | 34 | public List getAllPolitics() { 35 | return empMapper.getAllPolitics(); 36 | } 37 | 38 | public int addEmp(Employee employee) { 39 | Date beginContract = employee.getBeginContract(); 40 | Date endContract = employee.getEndContract(); 41 | Double contractTerm = (Double.parseDouble(yearFormat.format(endContract)) - Double.parseDouble(yearFormat.format(beginContract))) * 12 + Double.parseDouble(monthFormat.format(endContract)) - Double.parseDouble(monthFormat.format(beginContract)); 42 | employee.setContractTerm(Double.parseDouble(decimalFormat.format(contractTerm / 12))); 43 | return empMapper.addEmp(employee); 44 | } 45 | 46 | public Long getMaxWorkID() { 47 | Long maxWorkID = empMapper.getMaxWorkID(); 48 | return maxWorkID == null ? 0 : maxWorkID; 49 | } 50 | 51 | public List getEmployeeByPage(Integer page, Integer size, String keywords, Long politicId, Long nationId, Long posId, Long jobLevelId, String engageForm, Long departmentId, String beginDateScope) { 52 | int start = (page - 1) * size; 53 | Date startBeginDate = null; 54 | Date endBeginDate = null; 55 | if (beginDateScope != null && beginDateScope.contains(",")) { 56 | try { 57 | String[] split = beginDateScope.split(","); 58 | startBeginDate = birthdayFormat.parse(split[0]); 59 | endBeginDate = birthdayFormat.parse(split[1]); 60 | } catch (ParseException e) { 61 | } 62 | } 63 | return empMapper.getEmployeeByPage(start, size, keywords, politicId, nationId, posId, jobLevelId, engageForm, departmentId, startBeginDate, endBeginDate); 64 | } 65 | 66 | public Long getCountByKeywords(String keywords, Long politicId, Long nationId, Long posId, Long jobLevelId, String engageForm, Long departmentId, String beginDateScope) { 67 | Date startBeginDate = null; 68 | Date endBeginDate = null; 69 | if (beginDateScope != null && beginDateScope.contains(",")) { 70 | try { 71 | String[] split = beginDateScope.split(","); 72 | startBeginDate = birthdayFormat.parse(split[0]); 73 | endBeginDate = birthdayFormat.parse(split[1]); 74 | } catch (ParseException e) { 75 | } 76 | } 77 | return empMapper.getCountByKeywords(keywords, politicId, nationId, posId, jobLevelId, engageForm, departmentId, startBeginDate, endBeginDate); 78 | } 79 | 80 | public int updateEmp(Employee employee) { 81 | Date beginContract = employee.getBeginContract(); 82 | Date endContract = employee.getEndContract(); 83 | Double contractTerm = (Double.parseDouble(yearFormat.format(endContract)) - Double.parseDouble(yearFormat.format(beginContract))) * 12 + Double.parseDouble(monthFormat.format(endContract)) - Double.parseDouble(monthFormat.format(beginContract)); 84 | employee.setContractTerm(Double.parseDouble(decimalFormat.format(contractTerm / 12))); 85 | return empMapper.updateEmp(employee); 86 | } 87 | 88 | public boolean deleteEmpById(String ids) { 89 | String[] split = ids.split(","); 90 | return empMapper.deleteEmpById(split) == split.length; 91 | } 92 | 93 | public List getAllEmployees() { 94 | return empMapper.getEmployeeByPage(null, null, "", null, null, null, null, null, null, null, null); 95 | } 96 | 97 | public int addEmps(List emps) { 98 | return empMapper.addEmps(emps); 99 | } 100 | 101 | public List getEmployeeByPageShort(Integer page, Integer size) { 102 | int start = (page - 1) * size; 103 | return empMapper.getEmployeeByPageShort(start,size); 104 | } 105 | 106 | public Employee getEmpById(Long id){ 107 | return empMapper.getEmpById(id); 108 | } 109 | 110 | /* public Employee getEmpByIdAndName(String workID,String name){ 111 | return empMapper.getEmpByIdAndName(workID,name); 112 | }*/ 113 | } 114 | -------------------------------------------------------------------------------- /hrserver/src/main/java/org/sang/controller/emp/EmpBasicController.java: -------------------------------------------------------------------------------- 1 | package org.sang.controller.emp; 2 | 3 | import org.sang.bean.Employee; 4 | import org.sang.bean.Position; 5 | import org.sang.bean.RespBean; 6 | import org.sang.common.EmailRunnable; 7 | import org.sang.common.poi.PoiUtils; 8 | import org.sang.service.DepartmentService; 9 | import org.sang.service.EmpService; 10 | import org.sang.service.JobLevelService; 11 | import org.sang.service.PositionService; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.http.ResponseEntity; 14 | import org.springframework.mail.javamail.JavaMailSender; 15 | import org.springframework.web.bind.annotation.*; 16 | import org.springframework.web.multipart.MultipartFile; 17 | import org.thymeleaf.TemplateEngine; 18 | 19 | import java.util.HashMap; 20 | import java.util.List; 21 | import java.util.Map; 22 | import java.util.concurrent.ExecutorService; 23 | 24 | /** 25 | * Created by sang on 2018/1/12. 26 | */ 27 | @RestController 28 | @RequestMapping("/employee/basic") 29 | public class EmpBasicController { 30 | @Autowired 31 | EmpService empService; 32 | @Autowired 33 | DepartmentService departmentService; 34 | @Autowired 35 | PositionService positionService; 36 | @Autowired 37 | JobLevelService jobLevelService; 38 | @Autowired 39 | ExecutorService executorService; 40 | @Autowired 41 | TemplateEngine templateEngine; 42 | @Autowired 43 | JavaMailSender javaMailSender; 44 | 45 | @RequestMapping(value = "/basicdata", method = RequestMethod.GET) 46 | public Map getAllNations() { 47 | Map map = new HashMap<>(); 48 | map.put("nations", empService.getAllNations()); 49 | map.put("politics", empService.getAllPolitics()); 50 | map.put("deps", departmentService.getDepByPid(-1L)); 51 | map.put("positions", positionService.getAllPos()); 52 | map.put("joblevels", jobLevelService.getAllJobLevels()); 53 | map.put("workID", String.format("%08d", empService.getMaxWorkID() + 1)); 54 | return map; 55 | } 56 | 57 | @RequestMapping("/maxWorkID") 58 | public String maxWorkID() { 59 | return String.format("%08d", empService.getMaxWorkID() + 1); 60 | } 61 | 62 | @RequestMapping(value = "/emp", method = RequestMethod.POST) 63 | public RespBean addEmp(Employee employee) { 64 | if (empService.addEmp(employee) == 1) { 65 | List allPos = positionService.getAllPos(); 66 | for (Position allPo : allPos) { 67 | if (allPo.getId() == employee.getPosId()) { 68 | employee.setPosName(allPo.getName()); 69 | } 70 | } 71 | executorService.execute(new EmailRunnable(employee, 72 | javaMailSender, templateEngine)); 73 | return RespBean.ok("添加成功!"); 74 | } 75 | return RespBean.error("添加失败!"); 76 | } 77 | 78 | @RequestMapping(value = "/emp", method = RequestMethod.PUT) 79 | public RespBean updateEmp(Employee employee) { 80 | if (empService.updateEmp(employee) == 1) { 81 | return RespBean.ok("更新成功!"); 82 | } 83 | return RespBean.error("更新失败!"); 84 | } 85 | 86 | @RequestMapping(value = "/emp/{ids}", method = RequestMethod.DELETE) 87 | public RespBean deleteEmpById(@PathVariable String ids) { 88 | if (empService.deleteEmpById(ids)) { 89 | return RespBean.ok("删除成功!"); 90 | } 91 | return RespBean.error("删除失败!"); 92 | } 93 | 94 | @RequestMapping(value = "/emp", method = RequestMethod.GET) 95 | public Map getEmployeeByPage( 96 | @RequestParam(defaultValue = "1") Integer page, 97 | @RequestParam(defaultValue = "10") Integer size, 98 | @RequestParam(defaultValue = "") String keywords, 99 | Long politicId, Long nationId, Long posId, 100 | Long jobLevelId, String engageForm, 101 | Long departmentId, String beginDateScope) { 102 | Map map = new HashMap<>(); 103 | List employeeByPage = empService.getEmployeeByPage(page, size, 104 | keywords,politicId, nationId, posId, jobLevelId, engageForm, 105 | departmentId, beginDateScope); 106 | Long count = empService.getCountByKeywords(keywords, politicId, nationId, 107 | posId,jobLevelId, engageForm, departmentId, beginDateScope); 108 | map.put("emps", employeeByPage); 109 | map.put("count", count); 110 | return map; 111 | } 112 | 113 | @RequestMapping(value = "/exportEmp", method = RequestMethod.GET) 114 | public ResponseEntity exportEmp() { 115 | return PoiUtils.exportEmp2Excel(empService.getAllEmployees()); 116 | } 117 | 118 | @RequestMapping(value = "/importEmp", method = RequestMethod.POST) 119 | public RespBean importEmp(MultipartFile file) { 120 | List emps = PoiUtils.importEmp2List(file, 121 | empService.getAllNations(), empService.getAllPolitics(), 122 | departmentService.getAllDeps(), positionService.getAllPos(), 123 | jobLevelService.getAllJobLevels()); 124 | if (empService.addEmps(emps) == emps.size()) { 125 | return RespBean.ok("导入成功!"); 126 | } 127 | return RespBean.error("导入失败!"); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /hrserver/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 84 | @REM Fallback to current working directory if not found. 85 | 86 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 87 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 88 | 89 | set EXEC_DIR=%CD% 90 | set WDIR=%EXEC_DIR% 91 | :findBaseDir 92 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 93 | cd .. 94 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 95 | set WDIR=%CD% 96 | goto findBaseDir 97 | 98 | :baseDirFound 99 | set MAVEN_PROJECTBASEDIR=%WDIR% 100 | cd "%EXEC_DIR%" 101 | goto endDetectBaseDir 102 | 103 | :baseDirNotFound 104 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 105 | cd "%EXEC_DIR%" 106 | 107 | :endDetectBaseDir 108 | 109 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 110 | 111 | @setlocal EnableExtensions EnableDelayedExpansion 112 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 113 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 114 | 115 | :endReadAdditionalConfig 116 | 117 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 118 | 119 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 120 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 121 | 122 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 123 | if ERRORLEVEL 1 goto error 124 | goto end 125 | 126 | :error 127 | set ERROR_CODE=1 128 | 129 | :end 130 | @endlocal & set ERROR_CODE=%ERROR_CODE% 131 | 132 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 133 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 134 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 135 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 136 | :skipRcPost 137 | 138 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 139 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 140 | 141 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 142 | 143 | exit /B %ERROR_CODE% 144 | -------------------------------------------------------------------------------- /vuehr/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 13 | 14 | const env = require('../config/prod.env') 15 | 16 | const webpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ 19 | sourceMap: config.build.productionSourceMap, 20 | extract: true, 21 | usePostCSS: true 22 | }) 23 | }, 24 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 25 | output: { 26 | path: config.build.assetsRoot, 27 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 29 | }, 30 | plugins: [ 31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 32 | new webpack.DefinePlugin({ 33 | 'process.env': env 34 | }), 35 | new UglifyJsPlugin({ 36 | uglifyOptions: { 37 | compress: { 38 | warnings: false 39 | } 40 | }, 41 | sourceMap: config.build.productionSourceMap, 42 | parallel: true 43 | }), 44 | // extract css into its own file 45 | new ExtractTextPlugin({ 46 | filename: utils.assetsPath('css/[name].[contenthash].css'), 47 | // Setting the following option to `false` will not extract CSS from codesplit chunks. 48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. 49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 51 | allChunks: true, 52 | }), 53 | // Compress extracted CSS. We are using this plugin so that possible 54 | // duplicated CSS from different components can be deduped. 55 | new OptimizeCSSPlugin({ 56 | cssProcessorOptions: config.build.productionSourceMap 57 | ? { safe: true, map: { inline: false } } 58 | : { safe: true } 59 | }), 60 | // generate dist index.html with correct asset hash for caching. 61 | // you can customize output by editing /index.html 62 | // see https://github.com/ampedandwired/html-webpack-plugin 63 | new HtmlWebpackPlugin({ 64 | filename: config.build.index, 65 | template: 'index.html', 66 | inject: true, 67 | minify: { 68 | removeComments: true, 69 | collapseWhitespace: true, 70 | removeAttributeQuotes: true 71 | // more options: 72 | // https://github.com/kangax/html-minifier#options-quick-reference 73 | }, 74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 75 | chunksSortMode: 'dependency' 76 | }), 77 | // keep module.id stable when vender modules does not change 78 | new webpack.HashedModuleIdsPlugin(), 79 | // enable scope hoisting 80 | new webpack.optimize.ModuleConcatenationPlugin(), 81 | // split vendor js into its own file 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'vendor', 84 | minChunks (module) { 85 | // any required modules inside node_modules are extracted to vendor 86 | return ( 87 | module.resource && 88 | /\.js$/.test(module.resource) && 89 | module.resource.indexOf( 90 | path.join(__dirname, '../node_modules') 91 | ) === 0 92 | ) 93 | } 94 | }), 95 | // extract webpack runtime and module manifest to its own file in order to 96 | // prevent vendor hash from being updated whenever app bundle is updated 97 | new webpack.optimize.CommonsChunkPlugin({ 98 | name: 'manifest', 99 | minChunks: Infinity 100 | }), 101 | // This instance extracts shared chunks from code splitted chunks and bundles them 102 | // in a separate chunk, similar to the vendor chunk 103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 104 | new webpack.optimize.CommonsChunkPlugin({ 105 | name: 'app', 106 | async: 'vendor-async', 107 | children: true, 108 | minChunks: 3 109 | }), 110 | 111 | // copy custom static assets 112 | new CopyWebpackPlugin([ 113 | { 114 | from: path.resolve(__dirname, '../static'), 115 | to: config.build.assetsSubDirectory, 116 | ignore: ['.*'] 117 | } 118 | ]) 119 | ] 120 | }) 121 | 122 | if (config.build.productionGzip) { 123 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 124 | 125 | webpackConfig.plugins.push( 126 | new CompressionWebpackPlugin({ 127 | asset: '[path].gz[query]', 128 | algorithm: 'gzip', 129 | test: new RegExp( 130 | '\\.(' + 131 | config.build.productionGzipExtensions.join('|') + 132 | ')$' 133 | ), 134 | threshold: 10240, 135 | minRatio: 0.8 136 | }) 137 | ) 138 | } 139 | 140 | if (config.build.bundleAnalyzerReport) { 141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 143 | } 144 | 145 | module.exports = webpackConfig 146 | -------------------------------------------------------------------------------- /vuehr/src/components/system/basic/MenuRole.vue: -------------------------------------------------------------------------------- 1 | 50 | 160 | -------------------------------------------------------------------------------- /vuehr/src/components/chat/Notification.vue: -------------------------------------------------------------------------------- 1 | 76 | 161 | --------------------------------------------------------------------------------