├── README.md ├── ticketui ├── 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 │ ├── assets │ │ └── img │ │ │ ├── bg.jpg │ │ │ ├── button_bg.jpg │ │ │ ├── icon_mail.png │ │ │ ├── input_bg.png │ │ │ ├── logo_bg.jpg │ │ │ ├── top_logo.png │ │ │ ├── icon_iphone.png │ │ │ ├── button_hover.jpg │ │ │ └── nyimg │ │ │ ├── nytop_bg.png │ │ │ ├── title_bg.jpg │ │ │ ├── top_logo.png │ │ │ └── navbar_bg.jpg │ ├── components │ │ ├── system │ │ │ ├── SysLog.vue │ │ │ ├── SysBasic.vue │ │ │ ├── SysPwd.vue │ │ │ └── MenuRole.vue │ │ ├── chat │ │ │ ├── Chat.vue │ │ │ ├── Notification.vue │ │ │ └── FriendChat.vue │ │ ├── Login.vue │ │ └── Home.vue │ ├── App.vue │ ├── utils │ │ ├── filter_utils.js │ │ ├── utils.js │ │ └── api.js │ ├── router │ │ └── index.js │ ├── main.js │ └── store │ │ └── index.js ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── .babelrc ├── README.md ├── index.html └── package.json └── ticketserver ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── src └── main │ ├── resources │ ├── ftl │ │ └── top.jpg │ ├── static │ │ ├── static │ │ │ ├── img │ │ │ │ ├── bg.718d993.jpg │ │ │ │ ├── logo_bg.fea00ba.jpg │ │ │ │ └── button_bg.0407783.jpg │ │ │ ├── fonts │ │ │ │ ├── element-icons.6f0a763.ttf │ │ │ │ ├── fontawesome-webfont.674f50d.eot │ │ │ │ ├── fontawesome-webfont.b06871f.ttf │ │ │ │ ├── fontawesome-webfont.fee66e7.woff │ │ │ │ └── fontawesome-webfont.af7ae50.woff2 │ │ │ └── js │ │ │ │ └── manifest.7139b3f4670ee92cfb8e.js │ │ └── index.html │ ├── mybatis-config.xml │ └── application.properties │ └── java │ └── com │ └── stevlu │ ├── mapper │ ├── MenuRoleMapper.java │ ├── MenuMapper.java │ ├── RoleMapper.java │ ├── DepartmentMapper.java │ ├── PositionMapper.java │ ├── JobLevelMapper.java │ ├── RoleMapper.xml │ ├── SysMsgMapper.java │ ├── MenuRoleMapper.xml │ ├── PositionMapper.xml │ ├── HrMapper.java │ ├── JobLevelMapper.xml │ ├── DepartmentMapper.xml │ ├── SysMsgMapper.xml │ ├── TicketMapper.java │ ├── MenuMapper.xml │ └── HrMapper.xml │ ├── common │ ├── HrUtils.java │ ├── DateConverter.java │ └── EmailRunnable.java │ ├── WebSocketServerApplication.java │ ├── bean │ ├── MenuMeta.java │ ├── ChatResp.java │ ├── Role.java │ ├── RespBean.java │ ├── MsgContent.java │ ├── PoliticsStatus.java │ ├── SysMsg.java │ ├── Position.java │ ├── Affect.java │ ├── Server.java │ ├── Source.java │ ├── Priority.java │ ├── Declaration.java │ ├── JobLevel.java │ ├── EmailGroup.java │ ├── Questiontype.java │ ├── Subclass.java │ ├── Department.java │ ├── Menu.java │ ├── Hr.java │ └── Ticket.java │ ├── controller │ ├── DeptController.java │ ├── ConfigController.java │ ├── WsController.java │ ├── ChatController.java │ ├── SystemHrController.java │ ├── TicketBasicController.java │ └── SystemBasicController.java │ ├── service │ ├── MenuRoleService.java │ ├── RoleService.java │ ├── MenuService.java │ ├── PositionService.java │ ├── JobLevelService.java │ ├── DepartmentService.java │ ├── SysMsgService.java │ ├── HrService.java │ └── TicketService.java │ └── config │ ├── WebMvcConfig.java │ ├── WebSocketConfig.java │ ├── AuthenticationAccessDeniedHandler.java │ ├── UrlFilterInvocationSecurityMetadataSource.java │ ├── UrlAccessDecisionManager.java │ └── WebSecurityConfig.java ├── .gitignore ├── pom.xml ├── mvnw.cmd └── mvnw /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/README.md -------------------------------------------------------------------------------- /ticketui/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/build/logo.png -------------------------------------------------------------------------------- /ticketui/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /ticketui/src/assets/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/bg.jpg -------------------------------------------------------------------------------- /ticketui/src/assets/img/button_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/button_bg.jpg -------------------------------------------------------------------------------- /ticketui/src/assets/img/icon_mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/icon_mail.png -------------------------------------------------------------------------------- /ticketui/src/assets/img/input_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/input_bg.png -------------------------------------------------------------------------------- /ticketui/src/assets/img/logo_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/logo_bg.jpg -------------------------------------------------------------------------------- /ticketui/src/assets/img/top_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/top_logo.png -------------------------------------------------------------------------------- /ticketui/src/assets/img/icon_iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/icon_iphone.png -------------------------------------------------------------------------------- /ticketui/src/assets/img/button_hover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/button_hover.jpg -------------------------------------------------------------------------------- /ticketui/src/assets/img/nyimg/nytop_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/nyimg/nytop_bg.png -------------------------------------------------------------------------------- /ticketui/src/assets/img/nyimg/title_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/nyimg/title_bg.jpg -------------------------------------------------------------------------------- /ticketui/src/assets/img/nyimg/top_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/nyimg/top_logo.png -------------------------------------------------------------------------------- /ticketserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /ticketserver/src/main/resources/ftl/top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/ftl/top.jpg -------------------------------------------------------------------------------- /ticketui/src/assets/img/nyimg/navbar_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketui/src/assets/img/nyimg/navbar_bg.jpg -------------------------------------------------------------------------------- /ticketui/src/components/system/SysLog.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /ticketserver/.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 | -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/img/bg.718d993.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/img/bg.718d993.jpg -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/img/logo_bg.fea00ba.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/img/logo_bg.fea00ba.jpg -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/img/button_bg.0407783.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/img/button_bg.0407783.jpg -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/fonts/element-icons.6f0a763.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/fonts/element-icons.6f0a763.ttf -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.674f50d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.674f50d.eot -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.b06871f.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.b06871f.ttf -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.fee66e7.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.fee66e7.woff -------------------------------------------------------------------------------- /ticketui/.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 | -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.af7ae50.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevlu/ticket/HEAD/ticketserver/src/main/resources/static/static/fonts/fontawesome-webfont.af7ae50.woff2 -------------------------------------------------------------------------------- /ticketui/.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 | -------------------------------------------------------------------------------- /ticketui/.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 | -------------------------------------------------------------------------------- /ticketui/.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 | -------------------------------------------------------------------------------- /ticketserver/src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ticketserver/.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/ -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/MenuRoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | /** 6 | * Created by Steven Lu on 2018/11/21. 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.stevlu.bean.Menu; 6 | 7 | /** 8 | * Created by Steven Lu on 2018/11/21. 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/common/HrUtils.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.common; 2 | 3 | import org.springframework.security.core.context.SecurityContextHolder; 4 | 5 | import com.stevlu.bean.Hr; 6 | 7 | /** 8 | * Created by Steven Lu on 2018/11/21. 9 | */ 10 | public class HrUtils { 11 | public static Hr getCurrentHr() { 12 | return (Hr) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ticketui/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 22 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/RoleMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import com.stevlu.bean.Role; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Steven Lu on 2018/11/21. 11 | */ 12 | public interface RoleMapper { 13 | List roles(); 14 | 15 | int addNewRole(@Param("role") String role, @Param("roleZh") String roleZh); 16 | 17 | int deleteRoleById(Long rid); 18 | } 19 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/WebSocketServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.stevlu; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @MapperScan("com.stevlu.mapper") 9 | public class WebSocketServerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(WebSocketServerApplication.class, args); 13 | } 14 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/DepartmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import com.stevlu.bean.Department; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Steven Lu on 2018/11/21. 11 | */ 12 | public interface DepartmentMapper { 13 | void addDep(@Param("dep") Department department); 14 | 15 | void deleteDep(@Param("dep") Department department); 16 | 17 | List getDepByPid(Long pid); 18 | 19 | List getAllDeps(); 20 | } 21 | -------------------------------------------------------------------------------- /ticketui/README.md: -------------------------------------------------------------------------------- 1 | # Ticket 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:80 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/PositionMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import com.stevlu.bean.Position; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Steven Lu on 2018/11/21. 11 | */ 12 | public interface PositionMapper { 13 | 14 | int addPos(@Param("pos") Position pos); 15 | 16 | Position getPosByName(String name); 17 | 18 | List getAllPos(); 19 | 20 | int deletePosById(@Param("pids") String[] pids); 21 | 22 | int updatePosById(@Param("pos") Position position); 23 | } 24 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/MenuMeta.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven Lu on 2018/11/21. 5 | */ 6 | public class MenuMeta { 7 | 8 | private boolean keepAlive; 9 | private boolean requireAuth; 10 | 11 | public boolean isKeepAlive() { 12 | return keepAlive; 13 | } 14 | 15 | public void setKeepAlive(boolean keepAlive) { 16 | this.keepAlive = keepAlive; 17 | } 18 | 19 | public boolean isRequireAuth() { 20 | return requireAuth; 21 | } 22 | 23 | public void setRequireAuth(boolean requireAuth) { 24 | this.requireAuth = requireAuth; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/JobLevelMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import com.stevlu.bean.JobLevel; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Steven Lu on 2018/11/21. 11 | */ 12 | public interface JobLevelMapper { 13 | JobLevel getJobLevelByName(String name); 14 | 15 | int addJobLevel(@Param("jobLevel") JobLevel jobLevel); 16 | 17 | List getAllJobLevels(); 18 | 19 | int deleteJobLevelById(@Param("ids") String[] ids); 20 | 21 | int updateJobLevel(@Param("jobLevel") JobLevel jobLevel); 22 | } 23 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/ChatResp.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven Lu on 2018/11/21. 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Role.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven Lu on 2018/11/21. 5 | */ 6 | public class Role { 7 | private Long id; 8 | private String name; 9 | private String nameZh; 10 | 11 | public String getNameZh() { 12 | return nameZh; 13 | } 14 | 15 | public void setNameZh(String nameZh) { 16 | this.nameZh = nameZh; 17 | } 18 | 19 | public Long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(Long id) { 24 | this.id = id; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/RoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | INSERT INTO tkt_role (name, nameZh) values (#{role}, #{roleZh}) 11 | 12 | 13 | DELETE FROM tkt_role WHERE id=#{rid} 14 | 15 | -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/RespBean.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven Lu on 2018/11/21. 5 | */ 6 | public class RespBean { 7 | private String status; 8 | private String msg; 9 | 10 | public RespBean() { 11 | } 12 | 13 | public RespBean(String status, String msg) { 14 | 15 | this.status = status; 16 | this.msg = msg; 17 | } 18 | 19 | public String getStatus() { 20 | 21 | return status; 22 | } 23 | 24 | public void setStatus(String status) { 25 | this.status = status; 26 | } 27 | 28 | public String getMsg() { 29 | return msg; 30 | } 31 | 32 | public void setMsg(String msg) { 33 | this.msg = msg; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/SysMsgMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import com.stevlu.bean.Hr; 6 | import com.stevlu.bean.MsgContent; 7 | import com.stevlu.bean.SysMsg; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Created by Steven Lu on 2018/11/20. 13 | */ 14 | public interface SysMsgMapper { 15 | 16 | int sendMsg(MsgContent msg); 17 | 18 | int addMsg2AllHr(@Param("hrs") List
hrs, @Param("mid") Long mid); 19 | 20 | List getSysMsg(@Param("start") int start, @Param("size") Integer size, @Param("hrid") Long hrid); 21 | 22 | int markRead(@Param("flag") Long flag, @Param("hrid") Long hrid); 23 | } 24 | -------------------------------------------------------------------------------- /ticketui/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Ticket 11 | 12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/MenuRoleMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | DELETE FROM tkt_menu_role WHERE rid=#{rid} 8 | 9 | 10 | INSERT INTO tkt_menu_role(id,mid,rid) select SEQ_TKT_MENU_ROLE_NEWID.NEXTVAL, tmp.* from ( 11 | 12 | select #{mid},#{rid} from dual 13 | 14 | ) tmp 15 | 16 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/common/DateConverter.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.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 Steven Lu on 2018/11/21. 11 | */ 12 | public class DateConverter implements Converter { 13 | private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); 14 | 15 | @Override 16 | public Date convert(String s) { 17 | if ("".equals(s) || s == null) { 18 | return null; 19 | } 20 | try { 21 | return simpleDateFormat.parse(s); 22 | } catch (ParseException e) { 23 | e.printStackTrace(); 24 | } 25 | return null; 26 | } 27 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/controller/DeptController.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import com.stevlu.bean.Department; 8 | import com.stevlu.service.DepartmentService; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Steven Lu on 2018/11/21. 14 | */ 15 | @RestController 16 | @RequestMapping("/dept") 17 | public class DeptController { 18 | @Autowired 19 | DepartmentService departmentService; 20 | 21 | @RequestMapping("/deps") 22 | public List departments() { 23 | return departmentService.getAllDeps(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/MenuRoleService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Service; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | import com.stevlu.mapper.MenuRoleMapper; 9 | 10 | /** 11 | * Created by Steven Lu on 2018/11/21. 12 | */ 13 | @Service 14 | @Transactional 15 | public class MenuRoleService { 16 | @Autowired 17 | MenuRoleMapper menuRoleMapper; 18 | 19 | public int updateMenuRole(Long rid, Long[] mids) { 20 | menuRoleMapper.deleteMenuByRid(rid); 21 | if (mids.length == 0) { 22 | return 0; 23 | } 24 | return menuRoleMapper.addMenu(rid, mids); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ticketui/src/components/chat/Chat.vue: -------------------------------------------------------------------------------- 1 | 9 | 29 | -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | Ticket
-------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.format.FormatterRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 7 | 8 | import com.stevlu.common.DateConverter; 9 | 10 | import java.util.concurrent.ExecutorService; 11 | import java.util.concurrent.Executors; 12 | 13 | /** 14 | * Created by Steven Lu on 2018/11/21. 15 | */ 16 | @Configuration 17 | public class WebMvcConfig extends WebMvcConfigurerAdapter { 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/controller/ConfigController.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import com.stevlu.bean.Hr; 8 | import com.stevlu.bean.Menu; 9 | import com.stevlu.common.HrUtils; 10 | import com.stevlu.service.MenuService; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * 这是一个只要登录就能访问的Controller 主要用来获取一些配置信息 16 | */ 17 | @RestController 18 | @RequestMapping("/config") 19 | public class ConfigController { 20 | @Autowired 21 | MenuService menuService; 22 | 23 | @RequestMapping("/sysmenu") 24 | public List sysmenu() { 25 | return menuService.getMenusByHrId(); 26 | } 27 | 28 | @RequestMapping("/hr") 29 | public Hr currentUser() { 30 | return HrUtils.getCurrentHr(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/MsgContent.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | import java.util.Date; 4 | 5 | /** 6 | * Created by Steven Lu on 2018/11/21. 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/RoleService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import com.stevlu.bean.Role; 8 | import com.stevlu.mapper.RoleMapper; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Steven Lu on 2018/11/21. 14 | */ 15 | @Service 16 | @Transactional 17 | public class RoleService { 18 | @Autowired 19 | RoleMapper roleMapper; 20 | 21 | public List roles() { 22 | return roleMapper.roles(); 23 | } 24 | 25 | public int addNewRole(String role, String roleZh) { 26 | if (!role.startsWith("ROLE_")) { 27 | role = "ROLE_" + role; 28 | } 29 | return roleMapper.addNewRole(role, roleZh); 30 | } 31 | 32 | public int deleteRoleById(Long rid) { 33 | return roleMapper.deleteRoleById(rid); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ticketserver/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # EMBEDDED SERVER CONFIGURATION (ServerProperties) 2 | server.port=8082 3 | server.session-timeout=1800 4 | server.context-path= 5 | server.tomcat.max-threads=0 6 | server.tomcat.uri-encoding=UTF-8 7 | server.tomcat.basedir=target/tomcat 8 | 9 | # HTTP encoding (HttpEncodingProperties) 10 | spring.http.encoding.charset=UTF-8 11 | spring.http.encoding.enabled=true 12 | spring.http.encoding.force=true 13 | 14 | #datasource 15 | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource 16 | spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver 17 | spring.datasource.url=jdbc:oracle:thin:@//localhost:1521/orcl 18 | spring.datasource.username=scott 19 | spring.datasource.password=tiger 20 | #spring.datasource.url=jdbc:oracle:thin:@//192.168.103.235:1521/taf 21 | #spring.datasource.username=elite_ynj 22 | #spring.datasource.password=EYuc1809# 23 | mybatis.config-location=classpath:/mybatis-config.xml -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/MenuService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import com.stevlu.bean.Menu; 8 | import com.stevlu.common.HrUtils; 9 | import com.stevlu.mapper.MenuMapper; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Created by Steven Lu on 2018/11/21. 15 | */ 16 | @Service 17 | @Transactional 18 | public class MenuService { 19 | @Autowired 20 | MenuMapper menuMapper; 21 | 22 | public List getAllMenu() { 23 | return menuMapper.getAllMenu(); 24 | } 25 | 26 | public List getMenusByHrId() { 27 | return menuMapper.getMenusByHrId(HrUtils.getCurrentHr().getId()); 28 | } 29 | 30 | public List menuTree() { 31 | return menuMapper.menuTree(); 32 | } 33 | 34 | public List getMenusByRid(Long rid) { 35 | return menuMapper.getMenusByRid(rid); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ticketui/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 | if (minutes < 10) { 31 | minutes = '0' + minutes; 32 | } 33 | return year + "-" + month + "-" + day + " " + hours + ":" + minutes; 34 | }); 35 | 36 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/config/WebSocketConfig.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.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 | 9 | /** 10 | * Created by Steven Lu on 2018/11/21. 11 | */ 12 | @Configuration 13 | @EnableWebSocketMessageBroker 14 | public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { 15 | @Override 16 | public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) { 17 | stompEndpointRegistry.addEndpoint("/ws/endpointChat").withSockJS(); 18 | } 19 | 20 | @Override 21 | public void configureMessageBroker(MessageBrokerRegistry registry) { 22 | registry.enableSimpleBroker("/queue", "/topic"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/PoliticsStatus.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven Lu on 2018/11/21. 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) 13 | return true; 14 | if (o == null || getClass() != o.getClass()) 15 | return false; 16 | 17 | PoliticsStatus that = (PoliticsStatus) o; 18 | 19 | return name != null ? name.equals(that.name) : that.name == null; 20 | } 21 | 22 | @Override 23 | public int hashCode() { 24 | return name != null ? name.hashCode() : 0; 25 | } 26 | 27 | public PoliticsStatus(String name) { 28 | 29 | this.name = name; 30 | } 31 | 32 | public PoliticsStatus() { 33 | 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 | -------------------------------------------------------------------------------- /ticketui/src/components/system/SysBasic.vue: -------------------------------------------------------------------------------- 1 | 13 | 29 | 41 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/PositionMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | INSERT INTO tkt_position(name) values (#{pos.name}) 8 | 9 | 12 | 15 | 16 | DELETE FROM tkt_position WHERE id IN 17 | 18 | #{pid} 19 | 20 | 21 | 22 | UPDATE tkt_position set name=#{pos.name} WHERE id=#{pos.id} 23 | 24 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/config/AuthenticationAccessDeniedHandler.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.config; 2 | 3 | import org.springframework.security.access.AccessDeniedException; 4 | import org.springframework.security.web.access.AccessDeniedHandler; 5 | import org.springframework.stereotype.Component; 6 | 7 | import javax.servlet.ServletException; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.io.IOException; 11 | import java.io.PrintWriter; 12 | 13 | /** 14 | * Created by Steven Lu on 2018/11/21. 15 | */ 16 | @Component 17 | public class AuthenticationAccessDeniedHandler implements AccessDeniedHandler { 18 | @Override 19 | public void handle(HttpServletRequest httpServletRequest, HttpServletResponse resp, AccessDeniedException e) 20 | throws IOException, ServletException { 21 | resp.setStatus(HttpServletResponse.SC_FORBIDDEN); 22 | resp.setContentType("application/json;charset=UTF-8"); 23 | PrintWriter out = resp.getWriter(); 24 | out.write("{\"status\":\"error\",\"msg\":\"权限不足,请联系管理员!\"}"); 25 | out.flush(); 26 | out.close(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/PositionService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import com.stevlu.bean.Position; 8 | import com.stevlu.mapper.PositionMapper; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Steven Lu on 2018/11/21. 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/HrMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import com.stevlu.bean.Hr; 6 | import com.stevlu.bean.Role; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Steven Lu on 2018/10/30. 12 | */ 13 | public interface HrMapper { 14 | Hr loadUserByUsername(String username); 15 | 16 | List getRolesByHrId(Long id); 17 | 18 | int hrReg(@Param("username") String username, @Param("password") String password); 19 | 20 | int hrUpdatep(@Param("username") String username, @Param("password") String password); 21 | 22 | List
getHrsByKeywords(@Param("keywords") String keywords); 23 | 24 | int updateHr(Hr hr); 25 | 26 | int updateHrDept(Hr hr); 27 | 28 | int updateHrPhone(Hr hr); 29 | 30 | int updateHrEmail(Hr hr); 31 | 32 | int updateHrUsername(Hr hr); 33 | 34 | int updateHrName(Hr hr); 35 | 36 | int deleteRoleByHrId(Long hrId); 37 | 38 | int addRolesForHr(@Param("hrId") Long hrId, @Param("rids") Long[] rids); 39 | 40 | Hr getHrById(Long hrId); 41 | 42 | int deleteHr(Long hrId); 43 | 44 | List
getAllHr(@Param("currentId") Long currentId); 45 | } 46 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/controller/WsController.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.messaging.handler.annotation.MessageMapping; 5 | import org.springframework.messaging.handler.annotation.SendTo; 6 | import org.springframework.messaging.simp.SimpMessagingTemplate; 7 | import org.springframework.stereotype.Controller; 8 | 9 | import com.stevlu.bean.ChatResp; 10 | 11 | import java.security.Principal; 12 | 13 | /** 14 | * WebSocket 消息处理类 Created by Steven Lu on 2018/11/20. 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 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/SysMsg.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven Lu on 2018/11/21. 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/JobLevelService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import com.stevlu.bean.JobLevel; 8 | import com.stevlu.mapper.JobLevelMapper; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Steven Lu on 2018/11/21. 14 | */ 15 | @Service 16 | @Transactional 17 | public class JobLevelService { 18 | @Autowired 19 | JobLevelMapper jobLevelMapper; 20 | 21 | public int addJobLevel(JobLevel jobLevel) { 22 | /* 23 | * if (jobLevelMapper.getJobLevelByName(jobLevel.getName()) != null) { return 24 | * -1; } 25 | */ 26 | return jobLevelMapper.addJobLevel(jobLevel); 27 | } 28 | 29 | public List getAllJobLevels() { 30 | return jobLevelMapper.getAllJobLevels(); 31 | } 32 | 33 | public boolean deleteJobLevelById(String ids) { 34 | String[] split = ids.split(","); 35 | return jobLevelMapper.deleteJobLevelById(split) == split.length; 36 | } 37 | 38 | public int updateJobLevel(JobLevel jobLevel) { 39 | return jobLevelMapper.updateJobLevel(jobLevel); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/DepartmentService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import com.stevlu.bean.Department; 8 | import com.stevlu.mapper.DepartmentMapper; 9 | 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * Created by Steven Lu on 2018/10/30. 16 | */ 17 | @Service 18 | @Transactional 19 | public class DepartmentService { 20 | @Autowired 21 | DepartmentMapper departmentMapper; 22 | 23 | public int addDep(Department department) { 24 | department.setEnabled(1); 25 | departmentMapper.addDep(department); 26 | return department.getResult(); 27 | } 28 | 29 | public int deleteDep(Long did) { 30 | Department department = new Department(); 31 | department.setId(did); 32 | departmentMapper.deleteDep(department); 33 | return department.getResult(); 34 | } 35 | 36 | public List getDepByPid(Long pid) { 37 | return departmentMapper.getDepByPid(pid); 38 | } 39 | 40 | public List getAllDeps() { 41 | return departmentMapper.getAllDeps(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Position.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * Created by Steven Lu on 2018/11/21. 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) 19 | return true; 20 | if (o == null || getClass() != o.getClass()) 21 | return false; 22 | 23 | Position position = (Position) o; 24 | 25 | return name != null ? name.equals(position.name) : position.name == null; 26 | } 27 | 28 | @Override 29 | public int hashCode() { 30 | return name != null ? name.hashCode() : 0; 31 | } 32 | 33 | public Position(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 Timestamp getCreateDate() { 55 | return createDate; 56 | } 57 | 58 | public void setCreateDate(Timestamp createDate) { 59 | this.createDate = createDate; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Affect.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/10/22. 5 | */ 6 | public class Affect { 7 | private String affect_id; 8 | private String description; 9 | private Long flag; 10 | 11 | @Override 12 | public boolean equals(Object o) { 13 | if (this == o) 14 | return true; 15 | if (o == null || getClass() != o.getClass()) 16 | return false; 17 | 18 | Affect affect = (Affect) o; 19 | 20 | return description != null ? description.equals(affect.description) : affect.description == null; 21 | } 22 | 23 | @Override 24 | public int hashCode() { 25 | return description != null ? description.hashCode() : 0; 26 | } 27 | 28 | public Affect(String description) { 29 | 30 | this.description = description; 31 | } 32 | 33 | public Affect() { 34 | 35 | } 36 | 37 | public String getAffect_id() { 38 | return affect_id; 39 | } 40 | 41 | public void setAffect_id(String affect_id) { 42 | this.affect_id = affect_id; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | 53 | public Long getFlag() { 54 | return flag; 55 | } 56 | 57 | public void setFlag(Long flag) { 58 | this.flag = flag; 59 | } 60 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Server.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/10/22. 5 | */ 6 | public class Server { 7 | private String server_id; 8 | private String description; 9 | private Long flag; 10 | 11 | @Override 12 | public boolean equals(Object o) { 13 | if (this == o) 14 | return true; 15 | if (o == null || getClass() != o.getClass()) 16 | return false; 17 | 18 | Server server = (Server) o; 19 | 20 | return description != null ? description.equals(server.description) : server.description == null; 21 | } 22 | 23 | @Override 24 | public int hashCode() { 25 | return description != null ? description.hashCode() : 0; 26 | } 27 | 28 | public Server(String description) { 29 | 30 | this.description = description; 31 | } 32 | 33 | public Server() { 34 | 35 | } 36 | 37 | public String getServer_id() { 38 | return server_id; 39 | } 40 | 41 | public void setServer_id(String server_id) { 42 | this.server_id = server_id; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | 53 | public Long getFlag() { 54 | return flag; 55 | } 56 | 57 | public void setFlag(Long flag) { 58 | this.flag = flag; 59 | } 60 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Source.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/10/18. 5 | */ 6 | public class Source { 7 | private String source_id; 8 | private String description; 9 | private Long flag; 10 | 11 | @Override 12 | public boolean equals(Object o) { 13 | if (this == o) 14 | return true; 15 | if (o == null || getClass() != o.getClass()) 16 | return false; 17 | 18 | Source source = (Source) o; 19 | 20 | return description != null ? description.equals(source.description) : source.description == null; 21 | } 22 | 23 | @Override 24 | public int hashCode() { 25 | return description != null ? description.hashCode() : 0; 26 | } 27 | 28 | public Source(String description) { 29 | 30 | this.description = description; 31 | } 32 | 33 | public Source() { 34 | 35 | } 36 | 37 | public String getSource_id() { 38 | return source_id; 39 | } 40 | 41 | public void setSource_id(String source_id) { 42 | this.source_id = source_id; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | 53 | public Long getFlag() { 54 | return flag; 55 | } 56 | 57 | public void setFlag(Long flag) { 58 | this.flag = flag; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Priority.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/10/19. 5 | */ 6 | public class Priority { 7 | private String priority_id; 8 | private String description; 9 | private Long flag; 10 | 11 | @Override 12 | public boolean equals(Object o) { 13 | if (this == o) 14 | return true; 15 | if (o == null || getClass() != o.getClass()) 16 | return false; 17 | 18 | Priority priority = (Priority) o; 19 | 20 | return description != null ? description.equals(priority.description) : priority.description == null; 21 | } 22 | 23 | @Override 24 | public int hashCode() { 25 | return description != null ? description.hashCode() : 0; 26 | } 27 | 28 | public Priority(String description) { 29 | 30 | this.description = description; 31 | } 32 | 33 | public Priority() { 34 | 35 | } 36 | 37 | public String getPriority_id() { 38 | return priority_id; 39 | } 40 | 41 | public void setPriority_id(String priority_id) { 42 | this.priority_id = priority_id; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | 53 | public Long getFlag() { 54 | return flag; 55 | } 56 | 57 | public void setFlag(Long flag) { 58 | this.flag = flag; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Declaration.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/10/11. 5 | */ 6 | public class Declaration { 7 | private String declaration_id; 8 | private String description; 9 | private Long flag; 10 | 11 | @Override 12 | public boolean equals(Object o) { 13 | if (this == o) 14 | return true; 15 | if (o == null || getClass() != o.getClass()) 16 | return false; 17 | 18 | Declaration declaration = (Declaration) o; 19 | 20 | return description != null ? description.equals(declaration.description) : declaration.description == null; 21 | } 22 | 23 | @Override 24 | public int hashCode() { 25 | return description != null ? description.hashCode() : 0; 26 | } 27 | 28 | public Declaration(String description) { 29 | 30 | this.description = description; 31 | } 32 | 33 | public Declaration() { 34 | 35 | } 36 | 37 | public String getDeclaration_id() { 38 | return declaration_id; 39 | } 40 | 41 | public void setDeclaration_id(String declaration_id) { 42 | this.declaration_id = declaration_id; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | 53 | public Long getFlag() { 54 | return flag; 55 | } 56 | 57 | public void setFlag(Long flag) { 58 | this.flag = flag; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/JobLevelMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | INSERT INTO tkt_joblevel (name, titleLevel) values (#{jobLevel.name}, #{jobLevel.titleLevel}) 11 | 12 | 15 | 16 | DELETE FROM tkt_joblevel WHERE id IN 17 | 18 | #{id} 19 | 20 | 21 | 22 | UPDATE tkt_joblevel 23 | 24 | 25 | name=#{jobLevel.name}, 26 | 27 | 28 | titleLevel=#{jobLevel.titleLevel}, 29 | 30 | 31 | WHERE id=#{jobLevel.id} 32 | 33 | -------------------------------------------------------------------------------- /ticketserver/src/main/resources/static/static/js/manifest.7139b3f4670ee92cfb8e.js: -------------------------------------------------------------------------------- 1 | !function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,s=0,l=[];s getAttributes(Object o) throws IllegalArgumentException { 29 | return SecurityConfig.createList("ROLE_LOGIN"); 30 | } 31 | 32 | @Override 33 | public Collection getAllConfigAttributes() { 34 | return null; 35 | } 36 | 37 | @Override 38 | public boolean supports(Class aClass) { 39 | return FilterInvocation.class.isAssignableFrom(aClass); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/JobLevel.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * Created by Steven Lu on 2018/11/21. 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) 17 | return true; 18 | if (o == null || getClass() != o.getClass()) 19 | return false; 20 | 21 | JobLevel jobLevel = (JobLevel) o; 22 | 23 | return name != null ? name.equals(jobLevel.name) : jobLevel.name == null; 24 | } 25 | 26 | @Override 27 | public int hashCode() { 28 | return name != null ? name.hashCode() : 0; 29 | } 30 | 31 | public JobLevel() { 32 | 33 | } 34 | 35 | public JobLevel(String name) { 36 | 37 | this.name = name; 38 | } 39 | 40 | public Long getId() { 41 | return id; 42 | } 43 | 44 | public void setId(Long id) { 45 | this.id = id; 46 | } 47 | 48 | public String getName() { 49 | return name; 50 | } 51 | 52 | public void setName(String name) { 53 | this.name = name; 54 | } 55 | 56 | public String getTitleLevel() { 57 | return titleLevel; 58 | } 59 | 60 | public void setTitleLevel(String titleLevel) { 61 | this.titleLevel = titleLevel; 62 | } 63 | 64 | public Timestamp getCreateDate() { 65 | return createDate; 66 | } 67 | 68 | public void setCreateDate(Timestamp createDate) { 69 | this.createDate = createDate; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ticketui/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 SysPwd from '@/components/system/SysPwd' 7 | import TktDetail from '@/components/ticket/TktDetail' 8 | 9 | Vue.use(Router) 10 | 11 | export default new Router({ 12 | routes: [ 13 | { 14 | path: '/', 15 | name: 'Login', 16 | component: Login, 17 | hidden: true 18 | }, 19 | { 20 | path: '/home', 21 | name: '主页', 22 | component: Home, 23 | hidden: true, 24 | meta: { 25 | requireAuth: true 26 | }, 27 | children: [ 28 | { 29 | path: '/chat', 30 | name: '消息', 31 | component: Chat, 32 | hidden: true, 33 | meta: { 34 | keepAlive: false, 35 | requireAuth: true 36 | } 37 | }, 38 | { 39 | path: '/pwd', 40 | name: '修改密码', 41 | component: SysPwd, 42 | hidden: true, 43 | meta: { 44 | keepAlive: false, 45 | requireAuth: true 46 | } 47 | }, 48 | { 49 | path: '/tkt/detail', 50 | name: '工单细节', 51 | component: TktDetail, 52 | hidden: true, 53 | meta: { 54 | keepAlive: false, 55 | requireAuth: true 56 | } 57 | } 58 | ] 59 | } 60 | ] 61 | }) 62 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/DepartmentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 26 | -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/EmailGroup.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/11/06. 5 | */ 6 | public class EmailGroup { 7 | private String group_id; 8 | private String description; 9 | private String email; 10 | private Long flag; 11 | 12 | @Override 13 | public boolean equals(Object o) { 14 | if (this == o) 15 | return true; 16 | if (o == null || getClass() != o.getClass()) 17 | return false; 18 | 19 | EmailGroup emailgroup = (EmailGroup) o; 20 | 21 | return description != null ? description.equals(emailgroup.description) : emailgroup.description == null; 22 | } 23 | 24 | @Override 25 | public int hashCode() { 26 | return description != null ? description.hashCode() : 0; 27 | } 28 | 29 | public EmailGroup(String description) { 30 | 31 | this.description = description; 32 | } 33 | 34 | public EmailGroup() { 35 | 36 | } 37 | 38 | public String getGroup_id() { 39 | return group_id; 40 | } 41 | 42 | public void setGroup_id(String group_id) { 43 | this.group_id = group_id; 44 | } 45 | 46 | public String getDescription() { 47 | return description; 48 | } 49 | 50 | public void setDescription(String description) { 51 | this.description = description; 52 | } 53 | 54 | public String getEmail() { 55 | return email; 56 | } 57 | 58 | public void setEmail(String email) { 59 | this.email = email; 60 | } 61 | 62 | public Long getFlag() { 63 | return flag; 64 | } 65 | 66 | public void setFlag(Long flag) { 67 | this.flag = flag; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Questiontype.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/10/22. 5 | */ 6 | public class Questiontype { 7 | private String question_id; 8 | private String description; 9 | private Long orderno; 10 | private Long flag; 11 | 12 | @Override 13 | public boolean equals(Object o) { 14 | if (this == o) 15 | return true; 16 | if (o == null || getClass() != o.getClass()) 17 | return false; 18 | 19 | Questiontype questiontype = (Questiontype) o; 20 | 21 | return description != null ? description.equals(questiontype.description) : questiontype.description == null; 22 | } 23 | 24 | @Override 25 | public int hashCode() { 26 | return description != null ? description.hashCode() : 0; 27 | } 28 | 29 | public Questiontype(String description) { 30 | 31 | this.description = description; 32 | } 33 | 34 | public Questiontype() { 35 | 36 | } 37 | 38 | public String getQuestion_id() { 39 | return question_id; 40 | } 41 | 42 | public void setQuestion_id(String question_id) { 43 | this.question_id = question_id; 44 | } 45 | 46 | public String getDescription() { 47 | return description; 48 | } 49 | 50 | public void setDescription(String description) { 51 | this.description = description; 52 | } 53 | 54 | public Long getOrderno() { 55 | return orderno; 56 | } 57 | 58 | public void setOrderno(Long orderno) { 59 | this.orderno = orderno; 60 | } 61 | 62 | public Long getFlag() { 63 | return flag; 64 | } 65 | 66 | public void setFlag(Long flag) { 67 | this.flag = flag; 68 | } 69 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/SysMsgService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.access.prepost.PreAuthorize; 5 | import org.springframework.stereotype.Service; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | import com.stevlu.bean.Hr; 9 | import com.stevlu.bean.MsgContent; 10 | import com.stevlu.bean.SysMsg; 11 | import com.stevlu.common.HrUtils; 12 | import com.stevlu.mapper.SysMsgMapper; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * Created by Steven Lu on 2018/10/31. 18 | */ 19 | @Service 20 | @Transactional 21 | public class SysMsgService { 22 | @Autowired 23 | SysMsgMapper sysMsgMapper; 24 | @Autowired 25 | HrService hrService; 26 | 27 | @PreAuthorize("hasRole('ROLE_admin')") // 只有管理员可以发送系统消息 28 | public boolean sendMsg(MsgContent msg) { 29 | int result = sysMsgMapper.sendMsg(msg); 30 | if (result == 1) { 31 | List
allHr = hrService.getAllHr(); 32 | int result2 = sysMsgMapper.addMsg2AllHr(allHr, msg.getId()); 33 | return result2 == allHr.size(); 34 | } 35 | return false; 36 | } 37 | 38 | public List getSysMsgByPage(Integer page, Integer size) { 39 | int start = (page - 1) * size; 40 | return sysMsgMapper.getSysMsg(start, size, HrUtils.getCurrentHr().getId()); 41 | } 42 | 43 | public boolean markRead(Long flag) { 44 | if (flag != -1) { 45 | return sysMsgMapper.markRead(flag, HrUtils.getCurrentHr().getId()) == 1; 46 | } 47 | sysMsgMapper.markRead(flag, HrUtils.getCurrentHr().getId()); 48 | return true; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ticketui/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.2.7 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | const path = require('path') 5 | 6 | module.exports = { 7 | dev: { 8 | env: require('./dev.env'), 9 | port: 80, 10 | autoOpenBrowser: false, 11 | assetsSubDirectory: 'static', 12 | host: 'localhost', 13 | assetsPublicPath: '/', 14 | proxyTable: { 15 | '/': { 16 | target: 'http://localhost:8082', 17 | changeOrigin: true, 18 | pathRewrite: { 19 | '^/': '' 20 | } 21 | }, 22 | '/ws/*': { 23 | target: 'ws://localhost:8082', 24 | ws: true 25 | } 26 | }, 27 | cssSourceMap: false, 28 | }, 29 | build: { 30 | env: require('./prod.env'), 31 | index: path.resolve(__dirname, '../dist/index.html'), 32 | assetsRoot: path.resolve(__dirname, '../dist'), 33 | assetsSubDirectory: 'static', 34 | assetsPublicPath: '/', 35 | productionSourceMap: true, 36 | // Gzip off by default as many popular static hosts such as 37 | // Surge or Netlify already gzip all static assets for you. 38 | // Before setting to `true`, make sure to: 39 | // npm install --save-dev compression-webpack-plugin 40 | productionGzip: false, 41 | productionGzipExtensions: ['js', 'css'], 42 | // Run the build command with an extra argument to 43 | // View the bundle analyzer report after build finishes: 44 | // `npm run build --report` 45 | // Set to `true` or `false` to always turn it on or off 46 | bundleAnalyzerReport: process.env.npm_config_report 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ticketui/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 'element-ui/lib/theme-chalk/index.css' 5 | import App from './App' 6 | import router from './router' 7 | import ElementUI from 'element-ui' 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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Subclass.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | /** 4 | * Created by Steven on 2018/10/22. 5 | */ 6 | public class Subclass { 7 | private String subclass_id; 8 | private String questionid; 9 | private String description; 10 | private Long orderno; 11 | private Long flag; 12 | 13 | @Override 14 | public boolean equals(Object o) { 15 | if (this == o) 16 | return true; 17 | if (o == null || getClass() != o.getClass()) 18 | return false; 19 | 20 | Subclass subclass = (Subclass) o; 21 | 22 | return description != null ? description.equals(subclass.description) : subclass.description == null; 23 | } 24 | 25 | @Override 26 | public int hashCode() { 27 | return description != null ? description.hashCode() : 0; 28 | } 29 | 30 | public Subclass(String description) { 31 | 32 | this.description = description; 33 | } 34 | 35 | public Subclass() { 36 | 37 | } 38 | 39 | public String getSubclass_id() { 40 | return subclass_id; 41 | } 42 | 43 | public void setSubclass_id(String subclass_id) { 44 | this.subclass_id = subclass_id; 45 | } 46 | 47 | public String getDescription() { 48 | return description; 49 | } 50 | 51 | public void setDescription(String description) { 52 | this.description = description; 53 | } 54 | 55 | public String getQuestionid() { 56 | return questionid; 57 | } 58 | 59 | public void setQuestionid(String questionid) { 60 | this.questionid = questionid; 61 | } 62 | 63 | public Long getOrderno() { 64 | return orderno; 65 | } 66 | 67 | public void setOrderno(Long orderno) { 68 | this.orderno = orderno; 69 | } 70 | 71 | public Long getFlag() { 72 | return flag; 73 | } 74 | 75 | public void setFlag(Long flag) { 76 | this.flag = flag; 77 | } 78 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/config/UrlAccessDecisionManager.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.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 Steven Lu on 2018/11/21. 18 | */ 19 | @Component 20 | public class UrlAccessDecisionManager implements AccessDecisionManager { 21 | @Override 22 | public void decide(Authentication authentication, Object o, Collection collection) 23 | throws AccessDeniedException, AuthenticationException { 24 | Iterator iterator = collection.iterator(); 25 | while (iterator.hasNext()) { 26 | ConfigAttribute ca = iterator.next(); 27 | // 当前请求需要的权限 28 | String needRole = ca.getAttribute(); 29 | if ("ROLE_LOGIN".equals(needRole)) { 30 | if (authentication instanceof AnonymousAuthenticationToken) { 31 | throw new BadCredentialsException("未登录"); 32 | } else 33 | return; 34 | } 35 | // 当前用户所具有的权限 36 | Collection authorities = authentication.getAuthorities(); 37 | for (GrantedAuthority authority : authorities) { 38 | if (authority.getAuthority().equals(needRole)) { 39 | return; 40 | } 41 | } 42 | } 43 | throw new AccessDeniedException("权限不足!"); 44 | } 45 | 46 | @Override 47 | public boolean supports(ConfigAttribute configAttribute) { 48 | return true; 49 | } 50 | 51 | @Override 52 | public boolean supports(Class aClass) { 53 | return true; 54 | } 55 | } -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/controller/ChatController.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import com.stevlu.bean.Hr; 10 | import com.stevlu.bean.MsgContent; 11 | import com.stevlu.bean.RespBean; 12 | import com.stevlu.bean.SysMsg; 13 | import com.stevlu.service.HrService; 14 | import com.stevlu.service.SysMsgService; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | * 处理通知消息的Controller 登录即可访问 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 new RespBean("success", "发送成功!"); 38 | } 39 | return new RespBean("error", "发送失败!"); 40 | } 41 | 42 | @RequestMapping("/sysmsgs") 43 | public List getSysMsg(@RequestParam(value = "page", defaultValue = "1") Integer page, 44 | @RequestParam(value = "size", defaultValue = "10") Integer size) { 45 | return sysMsgService.getSysMsgByPage(page, size); 46 | } 47 | 48 | @RequestMapping(value = "/markread", method = RequestMethod.PUT) 49 | public RespBean markRead(Long flag) { 50 | if (sysMsgService.markRead(flag)) { 51 | if (flag == -1) { 52 | return new RespBean("success", "multiple"); 53 | } else { 54 | return new RespBean("success", "single"); 55 | } 56 | } else { 57 | if (flag == -1) { 58 | return new RespBean("error", "multiple"); 59 | } else { 60 | return new RespBean("error", "single"); 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ticketui/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 isNotNullORBlankForName = (args, msg)=> { 15 | for (var i = 0; i < args.length; i++) { 16 | var argument = args[i]; 17 | if (argument == null || argument == '' || argument == undefined) { 18 | Message.warning({message: msg}); 19 | return false; 20 | } 21 | } 22 | return true; 23 | } 24 | export const initMenu = (router, store)=> { 25 | if (store.state.routes.length > 0) { 26 | return; 27 | } 28 | getRequest("/config/sysmenu").then(resp=> { 29 | if (resp && resp.status == 200) { 30 | var fmtRoutes = formatRoutes(resp.data); 31 | router.addRoutes(fmtRoutes); 32 | store.commit('initMenu', fmtRoutes); 33 | store.dispatch('connect'); 34 | } 35 | }) 36 | } 37 | export const formatRoutes = (routes)=> { 38 | let fmRoutes = []; 39 | routes.forEach(router=> { 40 | let { 41 | path, 42 | component, 43 | name, 44 | meta, 45 | iconCls, 46 | children 47 | } = router; 48 | if (children && children instanceof Array) { 49 | children = formatRoutes(children); 50 | } 51 | let fmRouter = { 52 | path: path, 53 | component(resolve){ 54 | if (component.startsWith("Home")) { 55 | require(['../components/' + component + '.vue'], resolve) 56 | } else if (component.startsWith("Tkt")) { 57 | require(['../components/ticket/' + component + '.vue'], resolve) 58 | } else if (component.startsWith("Sys")) { 59 | require(['../components/system/' + component + '.vue'], resolve) 60 | } 61 | }, 62 | name: name, 63 | iconCls: iconCls, 64 | meta: meta, 65 | children: children 66 | }; 67 | fmRoutes.push(fmRouter); 68 | }) 69 | return fmRoutes; 70 | } 71 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/SysMsgMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | select (max(tkt_msgcontent.id) + 1) a from tkt_msgcontent 9 | 10 | INSERT INTO tkt_msgcontent(id,message,title) VALUES (#{id},#{message},#{title}) 11 | 12 | 13 | INSERT INTO tkt_sysmsg(id,mid,hrid) select SEQ_TKT_SYSMSG_NEWID.NEXTVAL, tmp.* from ( 14 | 15 | select #{mid},#{hr.id} from dual 16 | 17 | ) tmp 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | UPDATE tkt_sysmsg set state=1 WHERE hrid=#{hrid} 37 | 38 | AND mid=#{flag} 39 | 40 | 41 | -------------------------------------------------------------------------------- /ticketui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ticketvue", 3 | "version": "0.1.0", 4 | "description": "A Vue.js project", 5 | "author": "Steven Lu ", 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.17.1", 14 | "element-ui": "^2.0.9", 15 | "font-awesome": "^4.7.0", 16 | "node-sass": "^4.10.0", 17 | "sass-loader": "^7.1.0", 18 | "scss": "^0.2.4", 19 | "scss-loader": "0.0.1", 20 | "vue": "^2.5.2", 21 | "vue-router": "^3.0.1", 22 | "vue-stomp": "0.0.5", 23 | "vuex": "^3.0.1" 24 | }, 25 | "devDependencies": { 26 | "autoprefixer": "^7.1.2", 27 | "babel-core": "^6.22.1", 28 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 29 | "babel-loader": "^7.1.1", 30 | "babel-plugin-syntax-jsx": "^6.18.0", 31 | "babel-plugin-transform-runtime": "^6.22.0", 32 | "babel-plugin-transform-vue-jsx": "^3.5.0", 33 | "babel-preset-env": "^1.3.2", 34 | "babel-preset-stage-2": "^6.22.0", 35 | "chalk": "^2.0.1", 36 | "copy-webpack-plugin": "^4.0.1", 37 | "css-loader": "^0.28.0", 38 | "extract-text-webpack-plugin": "^3.0.0", 39 | "file-loader": "^1.1.4", 40 | "friendly-errors-webpack-plugin": "^1.6.1", 41 | "html-webpack-plugin": "^2.30.1", 42 | "node-notifier": "^5.1.2", 43 | "optimize-css-assets-webpack-plugin": "^3.2.0", 44 | "ora": "^1.2.0", 45 | "portfinder": "^1.0.13", 46 | "postcss-import": "^11.0.0", 47 | "postcss-loader": "^2.0.8", 48 | "rimraf": "^2.6.0", 49 | "semver": "^5.3.0", 50 | "shelljs": "^0.7.6", 51 | "uglifyjs-webpack-plugin": "^1.1.1", 52 | "url-loader": "^0.5.8", 53 | "vue-loader": "^13.3.0", 54 | "vue-style-loader": "^3.0.1", 55 | "vue-template-compiler": "^2.5.2", 56 | "webpack": "^3.6.0", 57 | "webpack-bundle-analyzer": "^2.9.0", 58 | "webpack-dev-server": "^2.9.1", 59 | "webpack-merge": "^4.1.0" 60 | }, 61 | "engines": { 62 | "node": ">= 4.0.0", 63 | "npm": ">= 3.0.0" 64 | }, 65 | "browserslist": [ 66 | "> 1%", 67 | "last 2 versions", 68 | "not ie <= 8" 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /ticketui/src/utils/api.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import {Message} from 'element-ui' 3 | 4 | axios.interceptors.request.use(config=> { 5 | return config; 6 | }, err=> { 7 | Message.error({message: '请求超时!'}); 8 | return Promise.resolve(err); 9 | }) 10 | axios.interceptors.response.use(data=> { 11 | if (data.status && data.status == 200 && data.data.status == 'error') { 12 | Message.error({message: data.data.msg}); 13 | return; 14 | } 15 | return data; 16 | }, err=> { 17 | if (err.response.status == 504||err.response.status == 404) { 18 | Message.error({message: '服务器被关闭了,请重启⊙﹏⊙∥'}); 19 | } else if (err.response.status == 403) { 20 | Message.error({message: '权限不足,请联系管理员!'}); 21 | }else { 22 | Message.error({message: '未知错误!'}); 23 | } 24 | return Promise.resolve(err); 25 | }) 26 | 27 | let base = ''; 28 | 29 | export const postRequest = (url, params) => { 30 | return axios({ 31 | method: 'post', 32 | url: `${base}${url}`, 33 | data: params, 34 | transformRequest: [function (data) { 35 | let ret = '' 36 | for (let it in data) { 37 | ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' 38 | } 39 | return ret 40 | }], 41 | headers: { 42 | 'Content-Type': 'application/x-www-form-urlencoded' 43 | } 44 | }); 45 | } 46 | export const uploadFileRequest = (url, params) => { 47 | return axios({ 48 | method: 'post', 49 | url: `${base}${url}`, 50 | data: params, 51 | headers: { 52 | 'Content-Type': 'multipart/form-data' 53 | } 54 | }); 55 | } 56 | export const putRequest = (url, params) => { 57 | return axios({ 58 | method: 'put', 59 | url: `${base}${url}`, 60 | data: params, 61 | transformRequest: [function (data) { 62 | let ret = '' 63 | for (let it in data) { 64 | ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' 65 | } 66 | return ret 67 | }], 68 | headers: { 69 | 'Content-Type': 'application/x-www-form-urlencoded' 70 | } 71 | }); 72 | } 73 | export const deleteRequest = (url) => { 74 | return axios({ 75 | method: 'delete', 76 | url: `${base}${url}` 77 | }); 78 | } 79 | export const getRequest = (url) => { 80 | return axios({ 81 | method: 'get', 82 | url: `${base}${url}` 83 | }); 84 | } 85 | -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/mapper/TicketMapper.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | import com.stevlu.bean.Affect; 6 | import com.stevlu.bean.Declaration; 7 | import com.stevlu.bean.EmailGroup; 8 | import com.stevlu.bean.Hr; 9 | import com.stevlu.bean.Priority; 10 | import com.stevlu.bean.Questiontype; 11 | import com.stevlu.bean.Server; 12 | import com.stevlu.bean.Source; 13 | import com.stevlu.bean.Subclass; 14 | import com.stevlu.bean.Ticket; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | * Created by Steven on 2018/10/09. 20 | */ 21 | public interface TicketMapper { 22 | 23 | List getAllDeclarations(); 24 | 25 | List getAllSources(); 26 | 27 | List getAllPriorities(); 28 | 29 | List getAllServers(); 30 | 31 | List getAllQuestiontypes(); 32 | 33 | List getAllSubclasses(@Param("questiontypeId") String questiontypeId); 34 | 35 | List getAllAffects(); 36 | 37 | List
getAllAssignees(); 38 | 39 | List getChildClass(@Param("questiontypeId") String questiontypeId); 40 | 41 | List getAllEmailGroups(); 42 | 43 | String getMaxLogId(); 44 | 45 | int addTicket(@Param("ticket") Ticket ticket); 46 | 47 | List getTicketByPage(@Param("start") Integer start, @Param("size") Integer size, 48 | @Param("keywords") String keywords, @Param("declarationId") String declarationId, 49 | @Param("sourceId") String sourceId, @Param("serverId") String serverId, @Param("affectId") String affectId, 50 | @Param("priorityId") String priorityId, @Param("status") String status, 51 | @Param("assigneeId") String assigneeId, @Param("groupId") String groupId); 52 | 53 | Long getCountByKeywords(@Param("keywords") String keywords, @Param("declarationId") String declarationId, 54 | @Param("sourceId") String sourceId, @Param("serverId") String serverId, @Param("affectId") String affectId, 55 | @Param("priorityId") String priorityId, @Param("status") String status, 56 | @Param("assigneeId") String assigneeId, @Param("groupId") String groupId); 57 | 58 | int deleteTicketById(@Param("ids") String[] ids); 59 | 60 | int updateTicket(@Param("ticket") Ticket ticket); 61 | 62 | int insertTicket(@Param("ticket") Ticket ticket); 63 | 64 | int updateAssignee(@Param("ticket") Ticket ticket); 65 | 66 | int sendEmail(@Param("ticket") Ticket ticket); 67 | } 68 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Department.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.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 Steven Lu on 2018/10/30. 10 | */ 11 | public class Department { 12 | private Long id; 13 | private String name; 14 | private Long parentId; 15 | private String depPath; 16 | private int enabled; 17 | private int 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) 29 | return true; 30 | if (o == null || getClass() != o.getClass()) 31 | return false; 32 | 33 | Department that = (Department) o; 34 | 35 | return name != null ? name.equals(that.name) : that.name == null; 36 | } 37 | 38 | @Override 39 | public int hashCode() { 40 | return name != null ? name.hashCode() : 0; 41 | } 42 | 43 | // 存储过程执行结果 44 | private Integer result; 45 | private List children = new ArrayList<>(); 46 | 47 | public List getChildren() { 48 | return children; 49 | } 50 | 51 | public void setChildren(List children) { 52 | this.children = children; 53 | } 54 | 55 | @JsonIgnore 56 | public Integer getResult() { 57 | return result; 58 | } 59 | 60 | public void setResult(Integer result) { 61 | this.result = result; 62 | } 63 | 64 | public Long getId() { 65 | return id; 66 | } 67 | 68 | public void setId(Long id) { 69 | this.id = id; 70 | } 71 | 72 | public String getName() { 73 | return name; 74 | } 75 | 76 | public void setName(String name) { 77 | this.name = name; 78 | } 79 | 80 | public Long getParentId() { 81 | return parentId; 82 | } 83 | 84 | public void setParentId(Long parentId) { 85 | this.parentId = parentId; 86 | } 87 | 88 | @JsonIgnore 89 | public String getDepPath() { 90 | return depPath; 91 | } 92 | 93 | public void setDepPath(String depPath) { 94 | this.depPath = depPath; 95 | } 96 | 97 | public int isEnabled() { 98 | return enabled; 99 | } 100 | 101 | public void setEnabled(int enabled) { 102 | this.enabled = enabled; 103 | } 104 | 105 | public int isParent() { 106 | return isParent; 107 | } 108 | 109 | public void setParent(int parent) { 110 | isParent = parent; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Menu.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import com.fasterxml.jackson.annotation.JsonIgnore; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by Steven Lu on 2018/11/21. 10 | */ 11 | public class Menu { 12 | private Long id; 13 | private String url; 14 | private String path; 15 | private Object component; 16 | private String name; 17 | private String iconCls; 18 | private Long parentId; 19 | private List roles; 20 | private List children; 21 | private MenuMeta meta; 22 | private boolean keepAlive; 23 | 24 | public boolean isKeepAlive() { 25 | return keepAlive; 26 | } 27 | 28 | public void setKeepAlive(boolean keepAlive) { 29 | this.keepAlive = keepAlive; 30 | } 31 | 32 | public MenuMeta getMeta() { 33 | return meta; 34 | } 35 | 36 | public void setMeta(MenuMeta meta) { 37 | this.meta = meta; 38 | } 39 | 40 | public List getChildren() { 41 | return children; 42 | } 43 | 44 | public void setChildren(List children) { 45 | this.children = children; 46 | } 47 | 48 | public Long getId() { 49 | return id; 50 | } 51 | 52 | public void setId(Long id) { 53 | this.id = id; 54 | } 55 | 56 | @JsonIgnore 57 | public String getUrl() { 58 | return url; 59 | } 60 | 61 | public void setUrl(String url) { 62 | this.url = url; 63 | } 64 | 65 | public String getPath() { 66 | return path; 67 | } 68 | 69 | public void setPath(String path) { 70 | this.path = path; 71 | } 72 | 73 | @JsonFormat(shape = JsonFormat.Shape.OBJECT) 74 | public Object getComponent() { 75 | return component; 76 | } 77 | 78 | public void setComponent(Object component) { 79 | this.component = component; 80 | } 81 | 82 | public String getName() { 83 | return name; 84 | } 85 | 86 | public void setName(String name) { 87 | this.name = name; 88 | } 89 | 90 | public String getIconCls() { 91 | return iconCls; 92 | } 93 | 94 | public void setIconCls(String iconCls) { 95 | this.iconCls = iconCls; 96 | } 97 | 98 | @JsonIgnore 99 | public Long getParentId() { 100 | return parentId; 101 | } 102 | 103 | public void setParentId(Long parentId) { 104 | this.parentId = parentId; 105 | } 106 | 107 | @JsonIgnore 108 | public List getRoles() { 109 | return roles; 110 | } 111 | 112 | public void setRoles(List roles) { 113 | this.roles = roles; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.stevlu 7 | TicketServer 8 | 0.1.0 9 | jar 10 | 11 | TicketServer 12 | Ticket project for Spring Boot Vue 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.4.5.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.mybatis.spring.boot 30 | mybatis-spring-boot-starter 31 | 1.3.1 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-security 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-web 40 | 41 | 42 | com.alibaba 43 | druid 44 | 1.0.29 45 | 46 | 47 | mysql 48 | mysql-connector-java 49 | 50 | 51 | com.oracle 52 | ojdbc14 53 | 10.2.0.4.0 54 | 55 | 56 | org.apache.poi 57 | poi 58 | 3.17 59 | 60 | 61 | com.sun.mail 62 | javax.mail 63 | 64 | 65 | org.freemarker 66 | freemarker 67 | 68 | 69 | org.springframework.boot 70 | spring-boot-starter-websocket 71 | 72 | 73 | 74 | 75 | 76 | org.springframework.boot 77 | spring-boot-maven-plugin 78 | 79 | 80 | 81 | 82 | src/main/java 83 | 84 | **/*.xml 85 | 86 | 87 | 88 | src/main/resources 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/HrService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.userdetails.UserDetails; 5 | import org.springframework.security.core.userdetails.UserDetailsService; 6 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 7 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 8 | import org.springframework.stereotype.Service; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.stevlu.bean.Hr; 12 | import com.stevlu.common.HrUtils; 13 | import com.stevlu.mapper.HrMapper; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * Created by Steven Lu on 2018/10/30. 19 | */ 20 | @Service 21 | @Transactional 22 | public class HrService implements UserDetailsService { 23 | 24 | @Autowired 25 | HrMapper hrMapper; 26 | 27 | @Override 28 | public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { 29 | Hr hr = hrMapper.loadUserByUsername(s); 30 | if (hr == null) { 31 | throw new UsernameNotFoundException("用户名不对"); 32 | } 33 | return hr; 34 | } 35 | 36 | public int hrReg(String username, String password) { 37 | // 如果用户名存在,返回错误 38 | if (hrMapper.loadUserByUsername(username) != null) { 39 | return -1; 40 | } 41 | BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); 42 | String encode = encoder.encode(password); 43 | return hrMapper.hrReg(username, encode); 44 | } 45 | 46 | public int hrUpdatep(String username, String oldPassword, String newPassword, String encodedPassword) { 47 | // 如果旧密码错误,返回错误 48 | BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); 49 | if (encoder.matches(oldPassword, encodedPassword)) { 50 | String encode = encoder.encode(newPassword); 51 | return hrMapper.hrUpdatep(username, encode); 52 | } else { 53 | return -1; 54 | } 55 | } 56 | 57 | public List
getHrsByKeywords(String keywords) { 58 | return hrMapper.getHrsByKeywords(keywords); 59 | } 60 | 61 | public int updateHr(Hr hr) { 62 | return hrMapper.updateHr(hr); 63 | } 64 | 65 | public int updateHrDept(Hr hr) { 66 | return hrMapper.updateHrDept(hr); 67 | } 68 | 69 | public int updateHrPhone(Hr hr) { 70 | return hrMapper.updateHrPhone(hr); 71 | } 72 | 73 | public int updateHrEmail(Hr hr) { 74 | return hrMapper.updateHrEmail(hr); 75 | } 76 | 77 | public int updateHrUsername(Hr hr) { 78 | return hrMapper.updateHrUsername(hr); 79 | } 80 | 81 | public int updateHrName(Hr hr) { 82 | return hrMapper.updateHrName(hr); 83 | } 84 | 85 | public int updateHrRoles(Long hrId, Long[] rids) { 86 | int i = hrMapper.deleteRoleByHrId(hrId); 87 | return hrMapper.addRolesForHr(hrId, rids); 88 | } 89 | 90 | public Hr getHrById(Long hrId) { 91 | return hrMapper.getHrById(hrId); 92 | } 93 | 94 | public int deleteHr(Long hrId) { 95 | return hrMapper.deleteHr(hrId); 96 | } 97 | 98 | public List
getAllHrExceptAdmin() { 99 | return hrMapper.getAllHr(HrUtils.getCurrentHr().getId()); 100 | } 101 | 102 | public List
getAllHr() { 103 | return hrMapper.getAllHr(null); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Hr.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.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 Steven Lu on 2018/10/30. 14 | */ 15 | public class Hr implements UserDetails { 16 | private Long id; 17 | private String name; 18 | private String phone; 19 | private String email; 20 | private String address; 21 | private boolean enabled; 22 | private String username; 23 | private String password; 24 | private Long dept; 25 | private List roles; 26 | private String userface; 27 | 28 | public String getUserface() { 29 | return userface; 30 | } 31 | 32 | public void setUserface(String userface) { 33 | this.userface = userface; 34 | } 35 | 36 | public List getRoles() { 37 | return roles; 38 | } 39 | 40 | public void setRoles(List roles) { 41 | this.roles = roles; 42 | } 43 | 44 | public Long getId() { 45 | return id; 46 | } 47 | 48 | public void setId(Long id) { 49 | this.id = id; 50 | } 51 | 52 | public String getName() { 53 | return name; 54 | } 55 | 56 | public void setName(String name) { 57 | this.name = name; 58 | } 59 | 60 | public String getPhone() { 61 | return phone; 62 | } 63 | 64 | public void setPhone(String phone) { 65 | this.phone = phone; 66 | } 67 | 68 | public String getEmail() { 69 | return email; 70 | } 71 | 72 | public void setEmail(String email) { 73 | this.email = email; 74 | } 75 | 76 | public String getAddress() { 77 | return address; 78 | } 79 | 80 | public void setAddress(String address) { 81 | this.address = address; 82 | } 83 | 84 | @Override 85 | public boolean isEnabled() { 86 | return enabled; 87 | } 88 | 89 | public void setEnabled(boolean enabled) { 90 | this.enabled = enabled; 91 | } 92 | 93 | @Override 94 | public String getUsername() { 95 | return username; 96 | } 97 | 98 | @JsonIgnore 99 | @Override 100 | public boolean isAccountNonExpired() { 101 | return true; 102 | } 103 | 104 | @JsonIgnore 105 | @Override 106 | public boolean isAccountNonLocked() { 107 | return true; 108 | } 109 | 110 | @JsonIgnore 111 | @Override 112 | public boolean isCredentialsNonExpired() { 113 | return true; 114 | } 115 | 116 | public void setUsername(String username) { 117 | this.username = username; 118 | } 119 | 120 | @JsonIgnore 121 | @Override 122 | public Collection getAuthorities() { 123 | List authorities = new ArrayList<>(); 124 | for (Role role : roles) { 125 | authorities.add(new SimpleGrantedAuthority(role.getName())); 126 | } 127 | return authorities; 128 | } 129 | 130 | @Override 131 | public String getPassword() { 132 | return password; 133 | } 134 | 135 | public void setPassword(String password) { 136 | this.password = password; 137 | } 138 | 139 | public Long getDept() { 140 | return dept; 141 | } 142 | 143 | public void setDept(Long dept) { 144 | this.dept = dept; 145 | } 146 | } -------------------------------------------------------------------------------- /ticketui/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 | //解决8082/index.html 登陆问题 21 | //stomp: Stomp.over(new SockJS("/ws/endpointChat")), 22 | nfDot: false 23 | }, 24 | mutations: { 25 | initMenu(state, menus){ 26 | state.routes = menus; 27 | }, 28 | login(state, user){ 29 | state.user = user; 30 | window.localStorage.setItem('user', JSON.stringify(user)); 31 | }, 32 | logout(state){ 33 | window.localStorage.removeItem('user'); 34 | state.routes = []; 35 | }, 36 | toggleNFDot(state, newValue){ 37 | state.nfDot = newValue; 38 | }, 39 | updateMsgList(state, newMsgList){ 40 | state.msgList = newMsgList; 41 | }, 42 | updateCurrentFriend(state, newFriend){ 43 | state.currentFriend = newFriend; 44 | }, 45 | addValue2DotMap(state, key){ 46 | state.isDotMap.set(key, "您有未读消息") 47 | }, 48 | removeValueDotMap(state, key){ 49 | state.isDotMap.delete(key); 50 | } 51 | }, 52 | actions: { 53 | connect(context){ 54 | context.state.stomp = Stomp.over(new SockJS("/ws/endpointChat")); 55 | context.state.stomp.connect({}, frame=> { 56 | context.state.stomp.subscribe("/user/queue/chat", message=> { 57 | var msg = JSON.parse(message.body); 58 | var oldMsg = window.localStorage.getItem(context.state.user.username + "#" + msg.from); 59 | if (oldMsg == null) { 60 | oldMsg = []; 61 | oldMsg.push(msg); 62 | window.localStorage.setItem(context.state.user.username + "#" + msg.from, JSON.stringify(oldMsg)) 63 | } else { 64 | var oldMsgJson = JSON.parse(oldMsg); 65 | oldMsgJson.push(msg); 66 | window.localStorage.setItem(context.state.user.username + "#" + msg.from, JSON.stringify(oldMsgJson)) 67 | } 68 | if (msg.from != context.state.currentFriend.username) { 69 | context.commit("addValue2DotMap", "isDot#" + context.state.user.username + "#" + msg.from); 70 | } 71 | //更新msgList 72 | var oldMsg2 = window.localStorage.getItem(context.state.user.username + "#" + context.state.currentFriend.username); 73 | if (oldMsg2 == null) { 74 | context.commit('updateMsgList', []); 75 | } else { 76 | context.commit('updateMsgList', JSON.parse(oldMsg2)); 77 | } 78 | }); 79 | context.state.stomp.subscribe("/topic/nf", message=> { 80 | context.commit('toggleNFDot', true); 81 | }); 82 | }, failedMsg=> { 83 | 84 | }); 85 | } 86 | } 87 | }); 88 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/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 | -------------------------------------------------------------------------------- /ticketui/src/components/system/SysPwd.vue: -------------------------------------------------------------------------------- 1 | 35 | 89 | 106 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/service/TicketService.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import org.springframework.transaction.annotation.Transactional; 6 | 7 | import com.stevlu.bean.Affect; 8 | import com.stevlu.bean.Declaration; 9 | import com.stevlu.bean.EmailGroup; 10 | import com.stevlu.bean.Hr; 11 | import com.stevlu.bean.Priority; 12 | import com.stevlu.bean.Questiontype; 13 | import com.stevlu.bean.Server; 14 | import com.stevlu.bean.Source; 15 | import com.stevlu.bean.Subclass; 16 | import com.stevlu.bean.Ticket; 17 | import com.stevlu.mapper.TicketMapper; 18 | 19 | import java.util.Date; 20 | import java.util.List; 21 | 22 | /** 23 | * Created by Steven on 2018/10/09. 24 | */ 25 | @Service 26 | @Transactional 27 | public class TicketService { 28 | @Autowired 29 | TicketMapper ticketMapper; 30 | 31 | public List getAllDeclarations() { 32 | return ticketMapper.getAllDeclarations(); 33 | } 34 | 35 | public List getAllSources() { 36 | return ticketMapper.getAllSources(); 37 | } 38 | 39 | public List getAllPriorities() { 40 | return ticketMapper.getAllPriorities(); 41 | } 42 | 43 | public List getAllServers() { 44 | return ticketMapper.getAllServers(); 45 | } 46 | 47 | public List getAllQuestiontypes() { 48 | return ticketMapper.getAllQuestiontypes(); 49 | } 50 | 51 | public List getAllSubclasses(String questiontypeId) { 52 | return ticketMapper.getAllSubclasses(questiontypeId); 53 | } 54 | 55 | public List getAllAffects() { 56 | return ticketMapper.getAllAffects(); 57 | } 58 | 59 | public List
getAllAssignees() { 60 | return ticketMapper.getAllAssignees(); 61 | } 62 | 63 | public List getChildClass(String questiontypeId) { 64 | return ticketMapper.getChildClass(questiontypeId); 65 | } 66 | 67 | public List getAllEmailGroups() { 68 | return ticketMapper.getAllEmailGroups(); 69 | } 70 | 71 | public String getMaxLogId() { 72 | return ticketMapper.getMaxLogId(); 73 | } 74 | 75 | public int addTicket(Ticket ticket) { 76 | return ticketMapper.addTicket(ticket); 77 | } 78 | 79 | public List getAllTickets() { 80 | return ticketMapper.getTicketByPage(null, null, "", null, null, null, null, null, "", null, null); 81 | } 82 | 83 | public List getTicketByPage(Integer page, Integer size, String keywords, String declarationId, 84 | String sourceId, String serverId, String affectId, String priorityId, String status, String assigneeId, 85 | String groupId) { 86 | int start = (page - 1) * size; 87 | return ticketMapper.getTicketByPage(start, size, keywords, declarationId, sourceId, serverId, affectId, 88 | priorityId, status, assigneeId, groupId); 89 | } 90 | 91 | public Long getCountByKeywords(String keywords, String declarationId, String sourceId, String serverId, 92 | String affectId, String priorityId, String status, String assigneeId, String groupId) { 93 | return ticketMapper.getCountByKeywords(keywords, declarationId, sourceId, serverId, affectId, priorityId, 94 | status, assigneeId, groupId); 95 | } 96 | 97 | public boolean deleteTicketById(String ids) { 98 | String[] split = ids.split(","); 99 | return ticketMapper.deleteTicketById(split) == split.length; 100 | } 101 | 102 | public int updateTicket(Ticket ticket) { 103 | return ticketMapper.updateTicket(ticket); 104 | } 105 | 106 | public int insertTicket(Ticket ticket) { 107 | return ticketMapper.insertTicket(ticket); 108 | } 109 | 110 | public int updateAssignee(Ticket ticket) { 111 | return ticketMapper.updateAssignee(ticket); 112 | } 113 | 114 | public int sendEmail(Ticket ticket) { 115 | return ticketMapper.sendEmail(ticket); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/controller/SystemHrController.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import com.stevlu.bean.Hr; 10 | import com.stevlu.bean.RespBean; 11 | import com.stevlu.service.HrService; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Steven Lu on 2018/10/30. 17 | */ 18 | @RestController 19 | @RequestMapping("/system/hr") 20 | public class SystemHrController { 21 | @Autowired 22 | HrService hrService; 23 | 24 | @RequestMapping("/id/{hrId}") 25 | public Hr getHrById(@PathVariable Long hrId) { 26 | return hrService.getHrById(hrId); 27 | } 28 | 29 | @RequestMapping(value = "/{hrId}", method = RequestMethod.DELETE) 30 | public RespBean deleteHr(@PathVariable Long hrId) { 31 | if (hrService.deleteHr(hrId) == 1) { 32 | return new RespBean("success", "删除成功!"); 33 | } 34 | return new RespBean("error", "删除失败!"); 35 | } 36 | 37 | @RequestMapping(value = "/", method = RequestMethod.PUT) 38 | public RespBean updateHr(Hr hr) { 39 | if (hrService.updateHr(hr) == 1) { 40 | return new RespBean("success", "更新成功!"); 41 | } 42 | return new RespBean("error", "更新失败!"); 43 | } 44 | 45 | @RequestMapping(value = "/dept", method = RequestMethod.PUT) 46 | public RespBean updateHrDept(Hr hr) { 47 | if (hrService.updateHrDept(hr) == 1) { 48 | return new RespBean("success", "更新成功!"); 49 | } 50 | return new RespBean("error", "更新失败!"); 51 | } 52 | 53 | @RequestMapping(value = "/phone", method = RequestMethod.PUT) 54 | public RespBean updateHrPhone(Hr hr) { 55 | if (hrService.updateHrPhone(hr) == 1) { 56 | return new RespBean("success", "更新成功!"); 57 | } 58 | return new RespBean("error", "更新失败!"); 59 | } 60 | 61 | @RequestMapping(value = "/email", method = RequestMethod.PUT) 62 | public RespBean updateHrEmail(Hr hr) { 63 | if (hrService.updateHrEmail(hr) == 1) { 64 | return new RespBean("success", "更新成功!"); 65 | } 66 | return new RespBean("error", "更新失败!"); 67 | } 68 | 69 | @RequestMapping(value = "/username", method = RequestMethod.PUT) 70 | public RespBean updateHrUsername(Hr hr) { 71 | if (hrService.updateHrUsername(hr) == 1) { 72 | return new RespBean("success", "更新成功!"); 73 | } 74 | return new RespBean("error", "更新失败!"); 75 | } 76 | 77 | @RequestMapping(value = "/name", method = RequestMethod.PUT) 78 | public RespBean updateHrName(Hr hr) { 79 | if (hrService.updateHrName(hr) == 1) { 80 | return new RespBean("success", "更新成功!"); 81 | } 82 | return new RespBean("error", "更新失败!"); 83 | } 84 | 85 | @RequestMapping(value = "/roles", method = RequestMethod.PUT) 86 | public RespBean updateHrRoles(Long hrId, Long[] rids) { 87 | if (hrService.updateHrRoles(hrId, rids) == rids.length) { 88 | return new RespBean("success", "更新成功!"); 89 | } 90 | return new RespBean("error", "更新失败!"); 91 | } 92 | 93 | @RequestMapping("/{keywords}") 94 | public List
getHrsByKeywords(@PathVariable(required = false) String keywords) { 95 | List
hrs = hrService.getHrsByKeywords(keywords); 96 | return hrs; 97 | } 98 | 99 | @RequestMapping(value = "/hr/reg", method = RequestMethod.POST) 100 | public RespBean hrReg(String username, String password) { 101 | int i = hrService.hrReg(username, password); 102 | if (i == 1) { 103 | return new RespBean("success", "注册成功!"); 104 | } else if (i == -1) { 105 | return new RespBean("error", "用户名重复,注册失败!"); 106 | } 107 | return new RespBean("error", "注册失败!"); 108 | } 109 | 110 | @RequestMapping(value = "/updatep", method = RequestMethod.PUT) 111 | public RespBean hrUpdatep(String username, String oldPassword, String newPassword, String encodedPassword) { 112 | int i = hrService.hrUpdatep(username, oldPassword, newPassword, encodedPassword); 113 | if (i == -1) { 114 | return new RespBean("error", "旧密码输入错误!"); 115 | } else if (i == 1) { 116 | return new RespBean("success", "修改成功,请重新登陆!"); 117 | } 118 | return new RespBean("error", "修改失败!"); 119 | } 120 | 121 | } 122 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/common/EmailRunnable.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.common; 2 | 3 | import freemarker.core.ParseException; 4 | import freemarker.template.*; 5 | 6 | import javax.activation.DataHandler; 7 | import javax.activation.DataSource; 8 | import javax.activation.FileDataSource; 9 | import javax.mail.*; 10 | import javax.mail.internet.MimeBodyPart; 11 | import javax.mail.internet.MimeMessage; 12 | import javax.mail.internet.MimeMultipart; 13 | 14 | import com.stevlu.bean.Ticket; 15 | 16 | import java.io.IOException; 17 | import java.io.StringWriter; 18 | import java.util.Properties; 19 | 20 | /** 21 | * Created by Steven Lu on 2018/11/21. 22 | */ 23 | public class EmailRunnable implements Runnable { 24 | 25 | private Ticket ticket; 26 | 27 | public EmailRunnable(Ticket ticket) { 28 | this.ticket = ticket; 29 | } 30 | 31 | @Override 32 | public void run() { 33 | try { 34 | Properties properties = new Properties(); 35 | /* properties.setProperty("mail.host", "smtp.partner.outlook.cn"); 36 | properties.setProperty("mail.transport.protocol", "smtp"); 37 | properties.setProperty("mail.smtp.auth", "true"); 38 | properties.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); 39 | properties.setProperty("mail.smtp.port", "587"); 40 | properties.put("mail.smtp.starttls.enable", "true");*/ 41 | properties.setProperty("mail.host", "smtp.qq.com"); 42 | properties.setProperty("mail.transport.protocol", "smtp"); 43 | properties.setProperty("mail.smtp.auth", "true"); 44 | properties.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); 45 | properties.setProperty("mail.smtp.port", "465"); 46 | Session session = Session.getDefaultInstance(properties); 47 | session.setDebug(true); 48 | Transport transport = session.getTransport(); 49 | /*transport.connect("Luke.Lu@ithelpdesk.cn", "Abc,123.");*/ 50 | transport.connect("smtp.qq.com", "stevlu@qq.com", "eaifqnvgsszvbbha"); 51 | MimeMessage mimeMessage = new MimeMessage(session); 52 | mimeMessage.addRecipients(Message.RecipientType.TO, ticket.getGemail()); 53 | /*mimeMessage.setFrom("Luke.Lu@ithelpdesk.cn");*/ 54 | mimeMessage.setFrom("stevlu@qq.com"); 55 | mimeMessage.setSubject((ticket.getLogId()).concat("已派单至系统")); 56 | MimeMultipart mixed = new MimeMultipart("mixed"); 57 | mimeMessage.setContent(mixed); 58 | MimeBodyPart content = new MimeBodyPart(); 59 | mixed.addBodyPart(content); 60 | MimeMultipart bodyMimeMultipart = new MimeMultipart("related"); 61 | content.setContent(bodyMimeMultipart); 62 | MimeBodyPart bodyPart = new MimeBodyPart(); 63 | // freemarker加载图片 64 | MimeBodyPart image = new MimeBodyPart(); 65 | //DataHandler dh = new DataHandler(new FileDataSource("src\\main\\resources\\ftl\\top.jpg")); 66 | DataHandler dh = new DataHandler(new FileDataSource("C:\\top.jpg")); 67 | image.setDataHandler(dh); 68 | image.setContentID("mailTopJpg"); 69 | // freemarker加载文本 70 | Configuration cfg = new Configuration(Configuration.VERSION_2_3_25); 71 | //cfg.setClassLoaderForTemplateLoading(ClassLoader.getSystemClassLoader(), "ftl"); 72 | cfg.setClassLoaderForTemplateLoading(getClass().getClassLoader(), "ftl"); 73 | cfg.setDefaultEncoding("UTF-8"); 74 | Template emailTemplate = cfg.getTemplate("email.ftl"); 75 | StringWriter out = new StringWriter(); 76 | emailTemplate.process(ticket, out); 77 | bodyPart.setContent(out.toString(), "text/html;charset=utf-8"); 78 | bodyMimeMultipart.addBodyPart(bodyPart); 79 | bodyMimeMultipart.addBodyPart(image); 80 | mimeMessage.saveChanges(); 81 | transport.sendMessage(mimeMessage, mimeMessage.getAllRecipients()); 82 | transport.close(); 83 | } catch (NoSuchProviderException e) { 84 | e.printStackTrace(); 85 | } catch (MessagingException e) { 86 | e.printStackTrace(); 87 | } catch (MalformedTemplateNameException e) { 88 | e.printStackTrace(); 89 | } catch (ParseException e) { 90 | e.printStackTrace(); 91 | } catch (TemplateNotFoundException e) { 92 | e.printStackTrace(); 93 | } catch (IOException e) { 94 | e.printStackTrace(); 95 | } catch (TemplateException e) { 96 | e.printStackTrace(); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/controller/TicketBasicController.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import com.stevlu.bean.*; 10 | import com.stevlu.common.EmailRunnable; 11 | import com.stevlu.service.TicketService; 12 | 13 | import java.util.HashMap; 14 | import java.util.List; 15 | import java.util.Map; 16 | import java.util.concurrent.ExecutorService; 17 | 18 | /** 19 | * Created by Steven on 2018/10/11. 20 | */ 21 | @RestController 22 | @RequestMapping("/ticket/basic") 23 | public class TicketBasicController { 24 | @Autowired 25 | TicketService ticketService; 26 | @Autowired 27 | ExecutorService executorService; 28 | 29 | @RequestMapping(value = "/lovdata", method = RequestMethod.GET) 30 | public Map getAllLOVs(String questiontypeId) { 31 | Map map = new HashMap<>(); 32 | map.put("declarations", ticketService.getAllDeclarations()); 33 | map.put("sources", ticketService.getAllSources()); 34 | map.put("priorities", ticketService.getAllPriorities()); 35 | map.put("servers", ticketService.getAllServers()); 36 | map.put("questiontypes", ticketService.getAllQuestiontypes()); 37 | map.put("subclasses", ticketService.getAllSubclasses(questiontypeId)); 38 | map.put("affects", ticketService.getAllAffects()); 39 | map.put("assignees", ticketService.getAllAssignees()); 40 | map.put("emailgroups", ticketService.getAllEmailGroups()); 41 | if ("0".equals(questiontypeId)) { 42 | map.put("updateLogId", ticketService.getMaxLogId()); 43 | } 44 | return map; 45 | } 46 | 47 | @RequestMapping(value = "/tkt", method = RequestMethod.GET) 48 | public Map getTicketByPage(@RequestParam(defaultValue = "1") Integer page, 49 | @RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "") String keywords, 50 | String declarationId, String sourceId, String serverId, String affectId, String priorityId, String status, 51 | String assigneeId, String groupId) { 52 | Map map = new HashMap<>(); 53 | List ticketByPage = ticketService.getTicketByPage(page, size, keywords, declarationId, sourceId, 54 | serverId, affectId, priorityId, status, assigneeId, groupId); 55 | Long count = ticketService.getCountByKeywords(keywords, declarationId, sourceId, serverId, affectId, priorityId, 56 | status, assigneeId, groupId); 57 | map.put("tickets", ticketByPage); 58 | map.put("count", count); 59 | return map; 60 | } 61 | 62 | @RequestMapping(value = "/getChildClass", method = RequestMethod.GET) 63 | public Map getChildClass(String questiontypeId) { 64 | Map map = new HashMap<>(); 65 | map.put("subclasses", ticketService.getChildClass(questiontypeId)); 66 | return map; 67 | } 68 | 69 | @RequestMapping(value = "/update", method = RequestMethod.PUT) 70 | public RespBean updateTicket(Ticket ticket) { 71 | if (ticketService.updateTicket(ticket) == 1) { 72 | return new RespBean("success", "修改成功!"); 73 | } 74 | return new RespBean("error", "修改失败!"); 75 | } 76 | 77 | @RequestMapping(value = "/insert", method = RequestMethod.PUT) 78 | public RespBean insertTicket(Ticket ticket) { 79 | if (ticketService.insertTicket(ticket) == 1) { 80 | return new RespBean("success", "修改成功!"); 81 | } 82 | return new RespBean("error", "修改失败!"); 83 | } 84 | 85 | @RequestMapping(value = "/assign", method = RequestMethod.PUT) 86 | public RespBean updateAssignee(Ticket ticket) { 87 | if (ticketService.updateAssignee(ticket) == 1) { 88 | return new RespBean("success", "修改成功!"); 89 | } 90 | return new RespBean("error", "修改失败!"); 91 | } 92 | 93 | @RequestMapping(value = "/email", method = RequestMethod.POST) 94 | public RespBean sendEmail(Ticket ticket) { 95 | if (ticketService.sendEmail(ticket) == 1) { 96 | executorService.execute(new EmailRunnable(ticket)); 97 | return new RespBean("success", "发信成功!"); 98 | } 99 | return new RespBean("error", "添加失败!"); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /ticketui/src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 40 | 74 | 154 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/config/WebSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.config; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import com.stevlu.common.HrUtils; 5 | import com.stevlu.service.HrService; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.security.authentication.BadCredentialsException; 10 | import org.springframework.security.authentication.DisabledException; 11 | import org.springframework.security.config.annotation.ObjectPostProcessor; 12 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 13 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 14 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 15 | import org.springframework.security.config.annotation.web.builders.WebSecurity; 16 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 17 | import org.springframework.security.core.Authentication; 18 | import org.springframework.security.core.AuthenticationException; 19 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 20 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 21 | import org.springframework.security.web.access.intercept.FilterSecurityInterceptor; 22 | import org.springframework.security.web.authentication.AuthenticationFailureHandler; 23 | import org.springframework.security.web.authentication.AuthenticationSuccessHandler; 24 | 25 | import javax.servlet.ServletException; 26 | import javax.servlet.http.HttpServletRequest; 27 | import javax.servlet.http.HttpServletResponse; 28 | import java.io.IOException; 29 | import java.io.PrintWriter; 30 | 31 | /** 32 | * Created by Steven Lu on 2018/11/21. 33 | */ 34 | @Configuration 35 | @EnableGlobalMethodSecurity(prePostEnabled = false) 36 | public class WebSecurityConfig extends WebSecurityConfigurerAdapter { 37 | 38 | @Autowired 39 | HrService hrService; 40 | @Autowired 41 | UrlFilterInvocationSecurityMetadataSource urlFilterInvocationSecurityMetadataSource; 42 | @Autowired 43 | UrlAccessDecisionManager urlAccessDecisionManager; 44 | @Autowired 45 | AuthenticationAccessDeniedHandler authenticationAccessDeniedHandler; 46 | 47 | @Override 48 | protected void configure(AuthenticationManagerBuilder auth) throws Exception { 49 | auth.userDetailsService(hrService).passwordEncoder(new BCryptPasswordEncoder()); 50 | } 51 | 52 | @Override 53 | public void configure(WebSecurity web) throws Exception { 54 | web.ignoring().antMatchers("/index.html", "/static/**"); 55 | } 56 | 57 | @Override 58 | protected void configure(HttpSecurity http) throws Exception { 59 | http 60 | .authorizeRequests() 61 | .withObjectPostProcessor(new ObjectPostProcessor() { 62 | @Override 63 | public O postProcess(O o) { 64 | o.setSecurityMetadataSource(urlFilterInvocationSecurityMetadataSource); 65 | o.setAccessDecisionManager(urlAccessDecisionManager); 66 | return o; 67 | } 68 | }) 69 | .and() 70 | .formLogin() 71 | .loginPage("/index.html") 72 | .loginProcessingUrl("/login") 73 | .usernameParameter("username") 74 | .passwordParameter("password") 75 | .permitAll() 76 | .failureHandler(new AuthenticationFailureHandler() { 77 | @Override 78 | public void onAuthenticationFailure(HttpServletRequest httpServletRequest, 79 | HttpServletResponse httpServletResponse, AuthenticationException e) 80 | throws IOException, ServletException { 81 | httpServletResponse.setContentType("application/json;charset=utf-8"); 82 | PrintWriter out = httpServletResponse.getWriter(); 83 | StringBuffer sb = new StringBuffer(); 84 | sb.append("{\"status\":\"error\",\"msg\":\""); 85 | if (e instanceof UsernameNotFoundException || e instanceof BadCredentialsException) { 86 | sb.append("用户名或密码输入错误,登录失败!"); 87 | } else if (e instanceof DisabledException) { 88 | sb.append("账户被禁用,登录失败,请联系管理员!"); 89 | } else { 90 | sb.append("登录失败!"); 91 | } 92 | sb.append("\"}"); 93 | out.write(sb.toString()); 94 | out.flush(); 95 | out.close(); 96 | } 97 | }) 98 | .successHandler(new AuthenticationSuccessHandler() { 99 | @Override 100 | public void onAuthenticationSuccess(HttpServletRequest httpServletRequest, 101 | HttpServletResponse httpServletResponse, Authentication authentication) 102 | throws IOException, ServletException { 103 | httpServletResponse.setContentType("application/json;charset=utf-8"); 104 | PrintWriter out = httpServletResponse.getWriter(); 105 | ObjectMapper objectMapper = new ObjectMapper(); 106 | String s = "{\"status\":\"success\",\"msg\":" 107 | + objectMapper.writeValueAsString(HrUtils.getCurrentHr()) + "}"; 108 | out.write(s); 109 | out.flush(); 110 | out.close(); 111 | } 112 | }) 113 | .and() 114 | .logout() 115 | .permitAll() 116 | .and() 117 | .csrf() 118 | .disable() 119 | .exceptionHandling() 120 | .accessDeniedHandler(authenticationAccessDeniedHandler); 121 | } 122 | } -------------------------------------------------------------------------------- /ticketserver/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 | -------------------------------------------------------------------------------- /ticketui/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 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/controller/SystemBasicController.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | import com.stevlu.bean.*; 10 | import com.stevlu.service.*; 11 | 12 | import java.util.HashMap; 13 | import java.util.List; 14 | import java.util.Map; 15 | 16 | /** 17 | * Created by Steven Lu on 2018/11/21. 18 | */ 19 | @RestController 20 | @RequestMapping("/system/basic") 21 | public class SystemBasicController { 22 | @Autowired 23 | RoleService roleService; 24 | @Autowired 25 | MenuService menuService; 26 | @Autowired 27 | MenuRoleService menuRoleService; 28 | @Autowired 29 | DepartmentService departmentService; 30 | @Autowired 31 | PositionService positionService; 32 | @Autowired 33 | JobLevelService jobLevelService; 34 | @Autowired 35 | TicketService ticketService; 36 | 37 | @RequestMapping(value = "/role/{rid}", method = RequestMethod.DELETE) 38 | public RespBean deleteRole(@PathVariable Long rid) { 39 | if (roleService.deleteRoleById(rid) == 1) { 40 | return new RespBean("success", "删除成功!"); 41 | } 42 | return new RespBean("error", "删除失败!"); 43 | } 44 | 45 | @RequestMapping(value = "/addRole", method = RequestMethod.POST) 46 | public RespBean addNewRole(String role, String roleZh) { 47 | if (roleService.addNewRole(role, roleZh) == 1) { 48 | return new RespBean("success", "添加成功!"); 49 | } 50 | return new RespBean("error", "添加失败!"); 51 | } 52 | 53 | @RequestMapping(value = "/menuTree/{rid}", method = RequestMethod.GET) 54 | public Map menuTree(@PathVariable Long rid) { 55 | Map map = new HashMap<>(); 56 | List menus = menuService.menuTree(); 57 | map.put("menus", menus); 58 | List selMids = menuService.getMenusByRid(rid); 59 | map.put("mids", selMids); 60 | return map; 61 | } 62 | 63 | @RequestMapping(value = "/updateMenuRole", method = RequestMethod.PUT) 64 | public RespBean updateMenuRole(Long rid, Long[] mids) { 65 | if (menuRoleService.updateMenuRole(rid, mids) == mids.length) { 66 | return new RespBean("success", "更新成功!"); 67 | } 68 | return new RespBean("error", "更新失败!"); 69 | } 70 | 71 | @RequestMapping("/roles") 72 | public List allRoles() { 73 | return roleService.roles(); 74 | } 75 | 76 | @RequestMapping(value = "/dep", method = RequestMethod.POST) 77 | public Map addDep(Department department) { 78 | Map map = new HashMap<>(); 79 | int result = departmentService.addDep(department); 80 | if (result >= 1) { 81 | map.put("status", "success"); 82 | map.put("msg", department); 83 | return map; 84 | } 85 | map.put("status", "error"); 86 | map.put("msg", "添加失败!"); 87 | return map; 88 | } 89 | 90 | @RequestMapping(value = "/dep/{did}", method = RequestMethod.DELETE) 91 | public RespBean deleteDep(@PathVariable Long did) { 92 | int result = departmentService.deleteDep(did); 93 | if (result > 0) { 94 | return new RespBean("success", "删除成功!"); 95 | } else if (result == -1) { 96 | return new RespBean("error", "部门正被员工使用,取消关联前无法删除!"); 97 | } 98 | return new RespBean("error", "删除失败!"); 99 | } 100 | 101 | @RequestMapping(value = "/dep/{pid}", method = RequestMethod.GET) 102 | public List getDepByPid(@PathVariable Long pid) { 103 | return departmentService.getDepByPid(pid); 104 | } 105 | 106 | @RequestMapping(value = "/deps", method = RequestMethod.GET) 107 | public List getAllDeps() { 108 | return departmentService.getAllDeps(); 109 | } 110 | 111 | @RequestMapping(value = "/position", method = RequestMethod.POST) 112 | public RespBean addPos(Position pos) { 113 | int result = positionService.addPos(pos); 114 | if (result == 1) { 115 | return new RespBean("success", "添加成功!"); 116 | } else if (result == -1) { 117 | return new RespBean("error", "职位名重复,添加失败!"); 118 | } 119 | return new RespBean("error", "添加失败!"); 120 | } 121 | 122 | @RequestMapping(value = "/positions", method = RequestMethod.GET) 123 | public List getAllPos() { 124 | return positionService.getAllPos(); 125 | } 126 | 127 | @RequestMapping("/position/{pids}") 128 | public RespBean deletePosById(@PathVariable String pids) { 129 | if (positionService.deletePosById(pids)) { 130 | return new RespBean("success", "删除成功!"); 131 | } 132 | return new RespBean("error", "删除失败!"); 133 | } 134 | 135 | @RequestMapping(value = "/position", method = RequestMethod.PUT) 136 | public RespBean updatePosById(Position position) { 137 | if (positionService.updatePosById(position) == 1) { 138 | return new RespBean("success", "修改成功!"); 139 | } 140 | return new RespBean("error", "修改失败!"); 141 | } 142 | 143 | @RequestMapping(value = "/joblevel", method = RequestMethod.POST) 144 | public RespBean addJobLevel(JobLevel jobLevel) { 145 | int result = jobLevelService.addJobLevel(jobLevel); 146 | if (result == 1) { 147 | return new RespBean("success", "添加成功!"); 148 | } else if (result == -1) { 149 | return new RespBean("error", "职称名重复,添加失败!"); 150 | } 151 | return new RespBean("error", "添加失败!"); 152 | } 153 | 154 | @RequestMapping(value = "/joblevels", method = RequestMethod.GET) 155 | public List getAllJobLevels() { 156 | return jobLevelService.getAllJobLevels(); 157 | } 158 | 159 | @RequestMapping(value = "/joblevel/{ids}", method = RequestMethod.DELETE) 160 | public RespBean deleteJobLevelById(@PathVariable String ids) { 161 | if (jobLevelService.deleteJobLevelById(ids)) { 162 | return new RespBean("success", "删除成功!"); 163 | } 164 | return new RespBean("error", "删除失败!"); 165 | } 166 | 167 | @RequestMapping(value = "/joblevel", method = RequestMethod.PUT) 168 | public RespBean updateJobLevel(JobLevel jobLevel) { 169 | if (jobLevelService.updateJobLevel(jobLevel) == 1) { 170 | return new RespBean("success", "修改成功!"); 171 | } 172 | return new RespBean("error", "修改失败!"); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /ticketui/src/components/chat/Notification.vue: -------------------------------------------------------------------------------- 1 | 77 | 163 | 177 | -------------------------------------------------------------------------------- /ticketui/src/components/chat/FriendChat.vue: -------------------------------------------------------------------------------- 1 | 53 | 127 | 172 | -------------------------------------------------------------------------------- /ticketui/src/components/system/MenuRole.vue: -------------------------------------------------------------------------------- 1 | 50 | 164 | 179 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/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 tkt_hr set username=#{username},password=#{password} 37 | 38 | 39 | update tkt_hr 40 | 41 | 42 | password = #{password,jdbcType=VARCHAR}, 43 | 44 | 45 | where username = #{username} 46 | 47 | 58 | 62 | 63 | update tkt_hr 64 | 65 | 66 | name = #{name,jdbcType=VARCHAR}, 67 | 68 | 69 | phone = #{phone,jdbcType=CHAR}, 70 | 71 | 72 | email = #{email,jdbcType=VARCHAR}, 73 | 74 | 75 | address = #{address,jdbcType=VARCHAR}, 76 | 77 | 78 | enabled = #{enabled,jdbcType=BIT}, 79 | 80 | 81 | username = #{username,jdbcType=VARCHAR}, 82 | 83 | 84 | password = #{password,jdbcType=VARCHAR}, 85 | 86 | 87 | userface = #{userface,jdbcType=VARCHAR}, 88 | 89 | 90 | dept = #{dept,jdbcType=INTEGER}, 91 | 92 | 93 | where id = #{id} 94 | 95 | 96 | update tkt_hr 97 | 98 | 99 | dept = #{dept,jdbcType=INTEGER}, 100 | 101 | 102 | where id = #{id} 103 | 104 | 105 | update tkt_hr 106 | 107 | 108 | phone = #{phone,jdbcType=INTEGER}, 109 | 110 | 111 | where id = #{id} 112 | 113 | 114 | update tkt_hr 115 | 116 | 117 | email = #{email,jdbcType=VARCHAR}, 118 | 119 | 120 | where id = #{id} 121 | 122 | 123 | update tkt_hr 124 | 125 | 126 | username = #{username,jdbcType=VARCHAR}, 127 | 128 | 129 | where id = #{id} 130 | 131 | 132 | update tkt_hr 133 | 134 | 135 | name = #{name,jdbcType=VARCHAR}, 136 | 137 | 138 | where id = #{id} 139 | 140 | 141 | DELETE FROM tkt_hr_role where hrid=#{hrId} 142 | 143 | 144 | INSERT INTO tkt_hr_role(id,hrid,rid) select SEQ_TKT_HR_ROLE_NEWID.NEXTVAL, tmp.* from ( 145 | 146 | select #{hrId}, #{rid} from dual 147 | 148 | ) tmp 149 | 150 | 151 | DELETE FROM tkt_hr WHERE id=#{hrId} 152 | 153 | 159 | -------------------------------------------------------------------------------- /ticketserver/src/main/java/com/stevlu/bean/Ticket.java: -------------------------------------------------------------------------------- 1 | package com.stevlu.bean; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * Created by Steven on 2018/10/09. 7 | */ 8 | public class Ticket { 9 | 10 | private String logId; 11 | private String title; 12 | private String describe; 13 | private String describehis; 14 | private Timestamp createdDate; 15 | private String emailCreatedDate; 16 | private String customerName; 17 | private String customerId; 18 | private String mobile; 19 | private String tel; 20 | private String email; 21 | private String gemail; 22 | private String status; 23 | private String vipId; 24 | private String vipdesc; 25 | private String declarationId; 26 | private String sourceId; 27 | private String priorityId; 28 | private String serverId; 29 | private String questiontypeId; 30 | private String subclassId; 31 | private String affectId; 32 | private String assigneeId; 33 | private String groupId; 34 | private Declaration declaration; 35 | private Source source; 36 | private Priority priority; 37 | private Server server; 38 | private Questiontype questiontype; 39 | private Subclass subclass; 40 | private Affect affect; 41 | private Hr hr; 42 | private EmailGroup emailgroup; 43 | 44 | public Ticket() { 45 | } 46 | 47 | public String getLogId() { 48 | return logId; 49 | } 50 | 51 | public void setLogId(String logId) { 52 | this.logId = logId; 53 | } 54 | 55 | public String getTitle() { 56 | return title; 57 | } 58 | 59 | public void setTitle(String title) { 60 | this.title = title; 61 | } 62 | 63 | public String getDescribe() { 64 | return describe; 65 | } 66 | 67 | public void setDescribe(String describe) { 68 | this.describe = describe; 69 | } 70 | 71 | public String getDescribehis() { 72 | return describehis; 73 | } 74 | 75 | public void setDescribehis(String describehis) { 76 | this.describehis = describehis; 77 | } 78 | 79 | public Timestamp getCreatedDate() { 80 | return createdDate; 81 | } 82 | 83 | public void setCreatedDate(Timestamp createdDate) { 84 | this.createdDate = createdDate; 85 | } 86 | 87 | public String getEmailCreatedDate() { 88 | return emailCreatedDate; 89 | } 90 | 91 | public void setEmailCreatedDate(String emailCreatedDate) { 92 | this.emailCreatedDate = emailCreatedDate; 93 | } 94 | 95 | public String getCustomerName() { 96 | return customerName; 97 | } 98 | 99 | public void setCustomerName(String customerName) { 100 | this.customerName = customerName; 101 | } 102 | 103 | public String getCustomerId() { 104 | return customerId; 105 | } 106 | 107 | public void setCustomerId(String customerId) { 108 | this.customerId = customerId; 109 | } 110 | 111 | public String getMobile() { 112 | return mobile; 113 | } 114 | 115 | public void setMobile(String mobile) { 116 | this.mobile = mobile; 117 | } 118 | 119 | public String getTel() { 120 | return tel; 121 | } 122 | 123 | public void setTel(String tel) { 124 | this.tel = tel; 125 | } 126 | 127 | public String getEmail() { 128 | return email; 129 | } 130 | 131 | public void setEmail(String email) { 132 | this.email = email; 133 | } 134 | 135 | public String getGemail() { 136 | return gemail; 137 | } 138 | 139 | public void setGemail(String gemail) { 140 | this.gemail = gemail; 141 | } 142 | 143 | public String getVipId() { 144 | return vipId; 145 | } 146 | 147 | public void setVipId(String vipId) { 148 | this.vipId = vipId; 149 | } 150 | 151 | public String getVipdesc() { 152 | return vipdesc; 153 | } 154 | 155 | public void setVipdesc(String vipdesc) { 156 | this.vipdesc = vipdesc; 157 | } 158 | 159 | public String getStatus() { 160 | return status; 161 | } 162 | 163 | public void setStatus(String status) { 164 | this.status = status; 165 | } 166 | 167 | public String getDeclarationId() { 168 | return declarationId; 169 | } 170 | 171 | public void setDeclarationId(String declarationId) { 172 | this.declarationId = declarationId; 173 | } 174 | 175 | public String getSourceId() { 176 | return sourceId; 177 | } 178 | 179 | public void setSourceId(String sourceId) { 180 | this.sourceId = sourceId; 181 | } 182 | 183 | public void setServerId(String serverId) { 184 | this.serverId = serverId; 185 | } 186 | 187 | public String getServerId() { 188 | return serverId; 189 | } 190 | 191 | public void setQuestiontypeId(String questiontypeId) { 192 | this.questiontypeId = questiontypeId; 193 | } 194 | 195 | public String getQuestiontypeId() { 196 | return questiontypeId; 197 | } 198 | 199 | public void setSubclassId(String subclassId) { 200 | this.subclassId = subclassId; 201 | } 202 | 203 | public String getSubclassId() { 204 | return subclassId; 205 | } 206 | 207 | public void setPriorityId(String priorityId) { 208 | this.priorityId = priorityId; 209 | } 210 | 211 | public String getPriorityId() { 212 | return priorityId; 213 | } 214 | 215 | public void setAffectId(String affectId) { 216 | this.affectId = affectId; 217 | } 218 | 219 | public String getAffectId() { 220 | return affectId; 221 | } 222 | 223 | public void setAssigneeId(String assigneeId) { 224 | this.assigneeId = assigneeId; 225 | } 226 | 227 | public String getAssigneeId() { 228 | return assigneeId; 229 | } 230 | 231 | public String getGroupId() { 232 | return groupId; 233 | } 234 | 235 | public void setGroupId(String groupId) { 236 | this.groupId = groupId; 237 | } 238 | 239 | public Declaration getDeclaration() { 240 | return declaration; 241 | } 242 | 243 | public void setDeclaration(Declaration declaration) { 244 | this.declaration = declaration; 245 | } 246 | 247 | public Source getSource() { 248 | return source; 249 | } 250 | 251 | public void setSource(Source source) { 252 | this.source = source; 253 | } 254 | 255 | public Priority getPriority() { 256 | return priority; 257 | } 258 | 259 | public void setPriority(Priority priority) { 260 | this.priority = priority; 261 | } 262 | 263 | public Server getServer() { 264 | return server; 265 | } 266 | 267 | public void setServer(Server server) { 268 | this.server = server; 269 | } 270 | 271 | public Questiontype getQuestiontype() { 272 | return questiontype; 273 | } 274 | 275 | public void setQuestiontype(Questiontype questiontype) { 276 | this.questiontype = questiontype; 277 | } 278 | 279 | public Subclass getSubclass() { 280 | return subclass; 281 | } 282 | 283 | public void setSubclass(Subclass subclass) { 284 | this.subclass = subclass; 285 | } 286 | 287 | public Affect getAffect() { 288 | return affect; 289 | } 290 | 291 | public void setAffect(Affect affect) { 292 | this.affect = affect; 293 | } 294 | 295 | public Hr getHr() { 296 | return hr; 297 | } 298 | 299 | public void setHr(Hr hr) { 300 | this.hr = hr; 301 | } 302 | 303 | public EmailGroup getEmailGroup() { 304 | return emailgroup; 305 | } 306 | 307 | public void setEmailGroup(EmailGroup emailgroup) { 308 | this.emailgroup = emailgroup; 309 | } 310 | 311 | } 312 | -------------------------------------------------------------------------------- /ticketserver/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Migwn, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | # TODO classpath? 118 | fi 119 | 120 | if [ -z "$JAVA_HOME" ]; then 121 | javaExecutable="`which javac`" 122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 123 | # readlink(1) is not available as standard on Solaris 10. 124 | readLink=`which readlink` 125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 126 | if $darwin ; then 127 | javaHome="`dirname \"$javaExecutable\"`" 128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 129 | else 130 | javaExecutable="`readlink -f \"$javaExecutable\"`" 131 | fi 132 | javaHome="`dirname \"$javaExecutable\"`" 133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 134 | JAVA_HOME="$javaHome" 135 | export JAVA_HOME 136 | fi 137 | fi 138 | fi 139 | 140 | if [ -z "$JAVACMD" ] ; then 141 | if [ -n "$JAVA_HOME" ] ; then 142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 143 | # IBM's JDK on AIX uses strange locations for the executables 144 | JAVACMD="$JAVA_HOME/jre/sh/java" 145 | else 146 | JAVACMD="$JAVA_HOME/bin/java" 147 | fi 148 | else 149 | JAVACMD="`which java`" 150 | fi 151 | fi 152 | 153 | if [ ! -x "$JAVACMD" ] ; then 154 | echo "Error: JAVA_HOME is not defined correctly." >&2 155 | echo " We cannot execute $JAVACMD" >&2 156 | exit 1 157 | fi 158 | 159 | if [ -z "$JAVA_HOME" ] ; then 160 | echo "Warning: JAVA_HOME environment variable is not set." 161 | fi 162 | 163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 164 | 165 | # traverses directory structure from process work directory to filesystem root 166 | # first directory with .mvn subdirectory is considered project base directory 167 | find_maven_basedir() { 168 | 169 | if [ -z "$1" ] 170 | then 171 | echo "Path not specified to find_maven_basedir" 172 | return 1 173 | fi 174 | 175 | basedir="$1" 176 | wdir="$1" 177 | while [ "$wdir" != '/' ] ; do 178 | if [ -d "$wdir"/.mvn ] ; then 179 | basedir=$wdir 180 | break 181 | fi 182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 183 | if [ -d "${wdir}" ]; then 184 | wdir=`cd "$wdir/.."; pwd` 185 | fi 186 | # end of workaround 187 | done 188 | echo "${basedir}" 189 | } 190 | 191 | # concatenates all lines of a file 192 | concat_lines() { 193 | if [ -f "$1" ]; then 194 | echo "$(tr -s '\n' ' ' < "$1")" 195 | fi 196 | } 197 | 198 | BASE_DIR=`find_maven_basedir "$(pwd)"` 199 | if [ -z "$BASE_DIR" ]; then 200 | exit 1; 201 | fi 202 | 203 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 204 | echo $MAVEN_PROJECTBASEDIR 205 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 206 | 207 | # For Cygwin, switch paths to Windows format before running java 208 | if $cygwin; then 209 | [ -n "$M2_HOME" ] && 210 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 211 | [ -n "$JAVA_HOME" ] && 212 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 213 | [ -n "$CLASSPATH" ] && 214 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 215 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 216 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 217 | fi 218 | 219 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 220 | 221 | exec "$JAVACMD" \ 222 | $MAVEN_OPTS \ 223 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 224 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 225 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 226 | -------------------------------------------------------------------------------- /ticketui/src/components/Home.vue: -------------------------------------------------------------------------------- 1 | 61 | 136 | 215 | --------------------------------------------------------------------------------