2020-07-07修改提交
commit
1f61ffe2b7
@ -0,0 +1,4 @@
|
||||
/target/
|
||||
/.idea/
|
||||
/out/
|
||||
power.iml
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
|
||||
</descriptors>
|
||||
<webroots>
|
||||
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
|
||||
</webroots>
|
||||
</configuration>
|
||||
</facet>
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="power-dao" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:3.11-beta2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.11-beta2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.11-beta2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.11-beta2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.poi:poi-excelant:3.11-beta2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.ant:ant:1.8.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.ant:ant-launcher:1.8.2" level="project" />
|
||||
<orderEntry type="module" module-name="power-service" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-test:5.1.3.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
|
||||
<orderEntry type="module" module-name="power-api" />
|
||||
<orderEntry type="module" module-name="power-foundaton" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk16:1.46" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.mail:javax.mail:1.5.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hyperic.sigar:com.springsource.org.hyperic.sigar:1.6.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:4.0.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.oshi:oshi-json:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.oshi:oshi-core:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.threeten:threetenbp:1.3.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:javax.json:1.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.servlet:jstl:1.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: taglibs:standard:1.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.2.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.miemiedev:mybatis-paginator:1.2.15" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.32" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:0.9.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.mchange:c3p0:0.9.5-pre6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:jsp-api:2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: fr.jrds:vxIPMI:2.0.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.9.5" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jdom:jdom:1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.java-websocket:Java-WebSocket:1.4.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.websocket:javax.websocket-api:1.1" level="project" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,14 @@
|
||||
package com.manage.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface RequiresPermissions {
|
||||
String value() default "";
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
|
||||
package com.manage.config;
|
||||
|
||||
import com.manage.entity.Power_Menu;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.web.bind.support.WebArgumentResolver;
|
||||
import org.springframework.web.context.request.NativeWebRequest;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Author: ljx
|
||||
* @Date: 2019/4/22 19:10
|
||||
* @Version 1.0
|
||||
* 获取当前保存在session里的对象 可通过在方法参数直接获取Power_User
|
||||
*/
|
||||
public class CurrentUserResolver implements WebArgumentResolver {
|
||||
|
||||
@Override
|
||||
public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest nativeWebRequest) throws Exception {
|
||||
if(methodParameter.getParameterType() != null && methodParameter.getParameterType().equals(Power_Menu.class)){
|
||||
HttpServletRequest request = nativeWebRequest.getNativeRequest(HttpServletRequest.class);
|
||||
Object currentUser = request.getSession().getAttribute("CURRENT_USER");
|
||||
return currentUser;
|
||||
}
|
||||
return UNRESOLVED;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.manage.config;
|
||||
|
||||
import com.manage.interfaces.webservice.PowerWebService;
|
||||
import com.manage.interfaces.webservice.impl.PowerWebServiceImpl;
|
||||
import org.apache.cxf.Bus;
|
||||
import org.apache.cxf.bus.spring.SpringBus;
|
||||
import org.apache.cxf.jaxws.EndpointImpl;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class WebServiceConfig {
|
||||
|
||||
@Bean(name = Bus.DEFAULT_BUS_ID)
|
||||
public SpringBus springBus() {
|
||||
return new SpringBus();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PowerWebService powerWebService() {
|
||||
return new PowerWebServiceImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Endpoint endpoint(){
|
||||
EndpointImpl endpoint = new EndpointImpl(springBus(),powerWebService());
|
||||
endpoint.publish("PowerWebService");
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,408 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.manage.annotation.OptionalLog;
|
||||
import com.manage.annotation.RequiresPermissions;
|
||||
import com.manage.entity.Power_Dept;
|
||||
import com.manage.entity.Power_User;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.ImportExcel.ImportExcelUtil;
|
||||
import com.manage.service.Power_DeptService;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.util.PageHelper;
|
||||
import com.manage.vo.ImportExcelEntity;
|
||||
import com.manage.vo.PowerTree;
|
||||
import com.manage.vo.Power_DeptVo;
|
||||
import com.manage.vo.Power_UserVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.multipart.MultipartResolver;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Author ly
|
||||
* Date 2019/4/20
|
||||
* Time 16:39
|
||||
* Description No Description
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dept")
|
||||
public class DeptController {
|
||||
|
||||
@Autowired
|
||||
private Power_DeptService powerDeptService;
|
||||
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 分页
|
||||
* */
|
||||
@RequestMapping("/pageList")
|
||||
@ResponseBody
|
||||
public PageHelper<Power_DeptVo> list(Power_DeptVo powerDept, HttpServletRequest request){
|
||||
PageHelper<Power_DeptVo>pageHelper = new PageHelper<Power_DeptVo>();
|
||||
try {
|
||||
//统计总记录数
|
||||
int total = powerDeptService.getTotal(powerDept);
|
||||
pageHelper.setTotal(total);
|
||||
//查询当前页实体对象
|
||||
List<Power_DeptVo> list = powerDeptService.findSomeByMore(powerDept,request);
|
||||
pageHelper.setRows(list);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
CacheManager.addExcCount("exc");
|
||||
}
|
||||
return pageHelper;
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 返回页面
|
||||
* */
|
||||
@OptionalLog(module = "查看",methods = "科室管理页面")
|
||||
@RequiresPermissions(value="/dept/pageUI")
|
||||
@RequestMapping("/pageUI")
|
||||
public String pageUI(HttpServletRequest request, Model model){
|
||||
Power_User powerUser1 =(Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
model.addAttribute("user",powerUser1);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "deptDir/dept";
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2020-01-02
|
||||
* @Author zwh
|
||||
* @Description 查看部门返回页面
|
||||
* */
|
||||
@OptionalLog(module = "查看",methods = "部门管理页面")
|
||||
@RequiresPermissions(value="/dept/bloodUI")
|
||||
@RequestMapping("/bloodUI")
|
||||
public String bloodUI(HttpServletRequest request, Model model){
|
||||
Power_User powerUser1 =(Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
model.addAttribute("user",powerUser1);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "deptDir/blood";
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2019-4-22
|
||||
* @Author ly
|
||||
* @Description 查询科室列表
|
||||
* */
|
||||
@RequestMapping("/selectList")
|
||||
@ResponseBody
|
||||
public Msg selectList(HttpServletRequest request) {
|
||||
try {
|
||||
List<Power_DeptVo> deptList = powerDeptService.selectDeptByUserId(request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("list",deptList);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-30
|
||||
* @Author ly
|
||||
* @Description 查询科室
|
||||
* */
|
||||
@RequestMapping("/selectDept")
|
||||
@ResponseBody
|
||||
public Power_Dept selectDept(Integer deptId) {
|
||||
try {
|
||||
Power_Dept power_dept = powerDeptService.selectByPrimaryKey(deptId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return power_dept;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2019-08-02
|
||||
* @Author zengwenhe
|
||||
* @Description 验证科室名不能重复
|
||||
* */
|
||||
@RequestMapping("/checkDeptName")
|
||||
@ResponseBody
|
||||
public Msg checkDeptName(String deptName,Integer dictId) {
|
||||
try {
|
||||
List<Power_Dept> power_dept = powerDeptService.checkDeptName(deptName,dictId);
|
||||
if(power_dept != null && !power_dept.isEmpty()){
|
||||
return Msg.fail("科室名已存在");
|
||||
}else{
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("验证失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2019-07-31
|
||||
* @Author zengwenhe
|
||||
* @Description 查询科室树
|
||||
* */
|
||||
@RequestMapping(value = "/selectDeptTreeByUserId",produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String selectDeptTreeByUserId(HttpServletRequest request) {
|
||||
try {
|
||||
List<Power_DeptVo> list = powerDeptService.selectDeptByUserId(request);
|
||||
List<PowerTree> treeList = new ArrayList<>();
|
||||
Map<Integer,String> hospitalMap = new HashMap<>();
|
||||
Integer id = 1;
|
||||
Integer parentId = null;
|
||||
if(null != list && !list.isEmpty()){
|
||||
for (int i = 0;i < list.size();i++){
|
||||
hospitalMap.put(list.get(i).getDictId(),list.get(i).getHospitalName());
|
||||
}
|
||||
for (Map.Entry<Integer, String> entry : hospitalMap.entrySet()) {
|
||||
//医院层
|
||||
PowerTree tree1 = new PowerTree();
|
||||
tree1.setId(id);
|
||||
tree1.setSelfId(entry.getKey());
|
||||
tree1.setName(entry.getValue());
|
||||
tree1.setParentId(0);
|
||||
treeList.add(tree1);
|
||||
parentId = id;
|
||||
id++;
|
||||
//科室层
|
||||
for (int i = 0;i < list.size();i++){
|
||||
if(entry.getKey().equals(list.get(i).getDictId())){
|
||||
PowerTree tree2 = new PowerTree();
|
||||
tree2.setId(id);
|
||||
tree2.setSelfId(list.get(i).getDeptId());
|
||||
tree2.setName(list.get(i).getDeptName());
|
||||
tree2.setParentId(parentId);
|
||||
treeList.add(tree2);
|
||||
id++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json = mapper.writeValueAsString(treeList);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return json;
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 新增科室
|
||||
* */
|
||||
@OptionalLog(module = "新增",methods = "科室管理",fieldName = "deptName")
|
||||
@RequiresPermissions(value="/dept/add")
|
||||
@RequestMapping("/add")
|
||||
@ResponseBody
|
||||
public Msg add(Power_Dept powerDept){
|
||||
try {
|
||||
List<Power_Dept> power_dept = powerDeptService.checkDeptName(powerDept.getDeptName(),powerDept.getDictId());
|
||||
if(null == power_dept || power_dept.isEmpty()){
|
||||
powerDeptService.insertSelective(powerDept);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}else{
|
||||
return Msg.fail("科室名已存在!");
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("添加出错了,请联系系统管理员!");
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 更新科室
|
||||
* */
|
||||
@OptionalLog(module = "修改",methods = "科室管理",fieldName = "deptName")
|
||||
@RequiresPermissions(value="/dept/update")
|
||||
@RequestMapping("/update")
|
||||
@ResponseBody
|
||||
public Msg update(Power_Dept powerDept,HttpServletRequest request){
|
||||
try {
|
||||
List<Power_Dept> power_dept = powerDeptService.checkDeptName(powerDept.getDeptName(),powerDept.getDictId());
|
||||
if(null != power_dept && !power_dept.isEmpty() && !power_dept.get(0).getDeptId().equals(powerDept.getDeptId())){
|
||||
return Msg.fail("科室名已存在!");
|
||||
}else{
|
||||
powerDeptService.updateByPrimaryKeySelective(powerDept,request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("修改出错了,请联系系统管理员!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 删除科室
|
||||
* */
|
||||
@OptionalLog(module = "删除",methods = "科室管理",fieldName = "deptName",tableName = "power_dept")
|
||||
@RequiresPermissions(value="/dept/delete")
|
||||
@RequestMapping("/delete")
|
||||
@ResponseBody
|
||||
public Msg delete(Integer deptId){
|
||||
try {
|
||||
CacheManager.addExcCount("noExc");
|
||||
powerDeptService.deleteByPrimaryKey(deptId);
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-29
|
||||
* @Author ly
|
||||
* @Description 导出Excel
|
||||
* */
|
||||
@OptionalLog(module = "导出excel",methods = "科室管理")
|
||||
@RequiresPermissions(value="/dept/export")
|
||||
@RequestMapping("/export")
|
||||
public void export(Power_DeptVo powerDept,HttpServletRequest request,HttpServletResponse response){
|
||||
try {
|
||||
powerDeptService.export(powerDept,request,response);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-22
|
||||
* @Author ly
|
||||
* @Description 根据一组科室id查询科室
|
||||
* */
|
||||
@RequestMapping("/findById")
|
||||
@ResponseBody
|
||||
public List<Power_Dept>findById(String dept_ids){
|
||||
try {
|
||||
List<Power_Dept>deptList = powerDeptService.selectByPrimaryKeys(dept_ids);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return deptList;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Date 2019-08-06
|
||||
* @Author zengwenhe
|
||||
* @Description 根据医院查询科室
|
||||
* */
|
||||
@RequestMapping("/selectDeptByDictId")
|
||||
@ResponseBody
|
||||
public Msg selectDeptByDictId(Integer dictId){
|
||||
try {
|
||||
List<Power_DeptVo> depts = powerDeptService.selectDeptByDictId(dictId,null);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("depts",depts);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("查询失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2019-10-11
|
||||
* @Author zengwh
|
||||
* @Description 导入excel
|
||||
* */
|
||||
@OptionalLog(module = "导入excel",methods = "科室管理")
|
||||
@RequiresPermissions(value="/dept/importExcel")
|
||||
@RequestMapping(value="/importExcel",method = {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> importExcel(HttpServletRequest request){
|
||||
OutputStream os = null;
|
||||
HttpHeaders responseHeaders = new HttpHeaders();
|
||||
responseHeaders.setContentType(new MediaType("text","html", Charset.forName("UTF-8")));
|
||||
try {
|
||||
//读取文件
|
||||
MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
|
||||
MultipartHttpServletRequest multipartRequest = resolver.resolveMultipart(request);
|
||||
MultipartFile multipartFile = multipartRequest.getFile("upfile");
|
||||
//属性名
|
||||
String[] fieldNames = {"deptName","dictId","effective","remark",};
|
||||
//判断集中类中的方法名
|
||||
String[] judgeMethods = {"judgeDeptName","judgeDictId","convertEffective","judgeRemark"};
|
||||
Power_Dept power_dept = new Power_Dept();
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Power_UserVo user = (Power_UserVo)request.getSession().getAttribute("CURRENT_USER");
|
||||
power_dept.setCreater(user.getUserName());
|
||||
power_dept.setUpdater(user.getUserName());
|
||||
power_dept.setCreateDate(fmt.format(new Date()));
|
||||
power_dept.setUpdateDate(fmt.format(new Date()));
|
||||
power_dept.setDeptCode("");
|
||||
//实例化
|
||||
ImportExcelUtil.newInstance("power_DeptMapper",power_dept, Power_Dept.class);
|
||||
//导入excel的操作
|
||||
ImportExcelEntity excelEntity = ImportExcelUtil.fileImport(multipartFile,fieldNames,judgeMethods);
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(excelEntity.getSuccessCount() == 0 && excelEntity.getWrongCount() == 0){
|
||||
//无数据
|
||||
return new ResponseEntity<String>("无数据!", responseHeaders, HttpStatus.OK);
|
||||
}
|
||||
if(excelEntity.getWrongCount() == 0){
|
||||
//成功
|
||||
return new ResponseEntity<String>(null, responseHeaders, HttpStatus.OK);
|
||||
}else{
|
||||
//有出错数据
|
||||
String msgStr = excelEntity.getWorkBookKey()+"@已成功导入"+excelEntity.getSuccessCount()+"条,失败"+excelEntity.getWrongCount()+"条,随后将导出错误记录!";
|
||||
return new ResponseEntity<String>(msgStr, responseHeaders, HttpStatus.OK);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
//抛异常
|
||||
return new ResponseEntity<String>(e.getMessage(), responseHeaders, HttpStatus.OK);
|
||||
}finally {
|
||||
if(os != null){
|
||||
try {
|
||||
os.close();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.ImportExcel.ImportExcelUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/10/12 12:20
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/10/12 12:20
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Controller
|
||||
public class ExportExcelController {
|
||||
@RequestMapping(value="exportWrongExcel")
|
||||
public void exportWrongExcel(String workBookKey,String fileName, HttpServletResponse response){
|
||||
OutputStream os = null;
|
||||
if(StringUtils.isNoneBlank(fileName)){
|
||||
//文件名
|
||||
fileName = "导入"+fileName+"时出错数据列表.xls";
|
||||
try {
|
||||
//导出excel的操作
|
||||
Workbook workbook = ImportExcelUtil.getWorkBookMapByKey(workBookKey);
|
||||
os = response.getOutputStream();
|
||||
response.reset();
|
||||
response.setContentType("application/OCTET-STREAM;charset=gbk");
|
||||
response.setHeader("pragma", "no-cache");
|
||||
fileName = new String(fileName.getBytes("utf-8"), "iso-8859-1");
|
||||
response.setHeader("Content-disposition", "attachment;filename=\"" + fileName + "\"");
|
||||
workbook.write(os);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if(os != null){
|
||||
try {
|
||||
os.close();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,503 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.manage.dao.Power_NoticeMapper;
|
||||
import com.manage.dao.Power_UserMapper;
|
||||
import com.manage.encrypt.Base64;
|
||||
import com.manage.encrypt.MD5;
|
||||
import com.manage.entity.*;
|
||||
import com.manage.service.*;
|
||||
import com.manage.service.cache.Cache;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.ipml.Power_NoticeServiceImpl;
|
||||
import com.manage.util.DateUtils;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.vo.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/7/9 15:07
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/7/9 15:07
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("font/")
|
||||
public class FontController {
|
||||
@Autowired
|
||||
private PowerService powerService;
|
||||
@Autowired
|
||||
private User_Dept_MenuService userDeptMenuService;
|
||||
@Autowired
|
||||
private Power_NoticeMapper powerNoticeMapper;
|
||||
@Autowired
|
||||
private Power_UserMapper userMapper;
|
||||
@Autowired
|
||||
private Power_NoticeServiceImpl noticeService;
|
||||
@Autowired
|
||||
private Power_UserService userService;
|
||||
@Value("${TOKEN_EXPIRE_TIME}")
|
||||
private long TOKEN_EXPIRE_TIME;
|
||||
@Autowired
|
||||
private Power_MenuService powerMenuService;
|
||||
@Autowired
|
||||
private Power_DeptService power_deptService;
|
||||
|
||||
/**
|
||||
* 2.1
|
||||
* @ProjectName: getUserPowerTreeBySysFlag
|
||||
* @Description: 获取菜单通过系统标识
|
||||
* @Param 无
|
||||
* @Return getMenusByUserIdAndSysFlag
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/7/9 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/7/9 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "getMenusByUserIdAndSysFlag",method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Msg getMenusByUserIdAndSysFlag(String userName,String sysFlag,Integer userId,Integer roleId,
|
||||
Integer sysId,Integer hospitalId){
|
||||
try {
|
||||
if(StringUtils.isNotBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
||||
&& sysId == null && hospitalId == null){
|
||||
return Msg.fail("查询复杂,数据大,暂不支持只带sysFlag参数查询");
|
||||
}
|
||||
if(StringUtils.isBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
||||
&& sysId != null && hospitalId == null){
|
||||
return Msg.fail("查询复杂,数据大,暂不支持只带sysId参数查询");
|
||||
}
|
||||
if(StringUtils.isBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
||||
&& sysId == null && hospitalId != null){
|
||||
return Msg.fail("查询复杂,数据大,暂不支持只带hospitalId参数查询");
|
||||
}
|
||||
if(StringUtils.isNotBlank(userName)){
|
||||
List<Power_User> power_users = userMapper.checkUserName(userName);
|
||||
if(null != power_users && !power_users.isEmpty()){
|
||||
if(power_users.get(0).getRoleId().equals(0) || power_users.get(0).getRoleId().equals(-100)){
|
||||
roleId = power_users.get(0).getRoleId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<User_Dept_Menu> list = userDeptMenuService.selectAll(userName, sysFlag, userId, roleId, sysId, hospitalId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("list",list);
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.2
|
||||
* @ProjectName: selectAllByUserIdOrRoleIdAndSysIdOrSysFlag
|
||||
* @Description: 根据用户id或角色id和系统id或系统标识查询通知记录
|
||||
* @Param 无
|
||||
* @Return selectAllByUserIdOrRoleIdAndSysIdOrSysFlag
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/7/29 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/7/29 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "selectAllByUserIdOrRoleIdAndSysIdOrSysFlag")
|
||||
@ResponseBody
|
||||
public Msg selectAllByUserIdOrRoleIdAndSysIdOrSysFlag(Integer userId,Integer roleId,Integer sysId,String sysFlag){
|
||||
try {
|
||||
List<Power_Notice> list = powerNoticeMapper.selectAllByUserIdOrRoleIdAndSysIdOrSysFlag(userId, roleId, sysId, sysFlag);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("list",list);
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.4
|
||||
* @ProjectName: getUserPowerTreeBySysFlag
|
||||
* @Description: 获取系统用户树通过系统标识
|
||||
* @Param 无
|
||||
* @Return PowerTree
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/7/9 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/7/9 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "getUserPowerTreeBySysFlag",produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String getUserPowerTreeBySysFlag(String sysFlag,Integer userId){
|
||||
try {
|
||||
if(null != userId){
|
||||
//查询该用户
|
||||
Power_UserVo user = userMapper.selectByPrimaryKey(userId);
|
||||
List<PowerTree> dicts = powerService.getUserPowerTreeBySysFlag(sysFlag,user);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json = mapper.writeValueAsString(dicts);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return json;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.5
|
||||
* @ProjectName: getRolePowerTreeBySysFlag
|
||||
* @Description: 获取系统角色树通过系统标识
|
||||
* @Param 无
|
||||
* @Return PowerTree
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/7/9 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/7/9 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "getRolePowerTreeBySysFlag",produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String getRolePowerTreeBySysFlag(String sysFlag,Integer userId){
|
||||
try {
|
||||
if(null != userId){
|
||||
Power_UserVo user = userMapper.selectByPrimaryKey(userId);
|
||||
List<PowerTree> dicts = powerService.getRolePowerTreeBySysFlag(sysFlag,user);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json = mapper.writeValueAsString(dicts);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return json;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.6
|
||||
* @ProjectName: getUserList
|
||||
* @Description: 获取用户id和用户名
|
||||
* @Param 无
|
||||
* @Return userList
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/9/6 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/9/6 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "getUserList")
|
||||
@ResponseBody
|
||||
public Msg getUserList(String userName){
|
||||
try {
|
||||
List<User> list = new ArrayList<>();
|
||||
if(StringUtils.isNoneBlank(userName)){
|
||||
List<Power_User> users = userMapper.checkUserName(userName);
|
||||
if(null != users && !users.isEmpty()){
|
||||
Integer roleId = users.get(0).getRoleId();
|
||||
if(roleId == 0){
|
||||
list = userMapper.selectUserIdAndUserNameList(null);
|
||||
}else{
|
||||
list = userMapper.selectUserIdAndUserNameList(users.get(0).getUserId());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return Msg.fail("用户名不能为空");
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("userList",list);
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.7
|
||||
* @ProjectName: checkToken
|
||||
* @Description: 验证token是否有效
|
||||
* @Param 无
|
||||
* @Return Msg
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/9/24 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/9/24 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "checkToken",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Msg checkToken(String token){
|
||||
try {
|
||||
if(StringUtils.isNotBlank(token) && StringUtils.isNotBlank(token) ) {
|
||||
token = MD5.JM(Base64.decode(token));
|
||||
Cache cache = CacheManager.getCacheInfo(token);
|
||||
if (cache == null) {
|
||||
return Msg.fail("token已过期或不存在");
|
||||
}
|
||||
}else{
|
||||
return Msg.fail("token不能为空");
|
||||
}
|
||||
return Msg.success();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.8
|
||||
* @ProjectName: getUserByToken
|
||||
* @Description: 根据token获取用户
|
||||
* @Param 无
|
||||
* @Return getMenuListByToken
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/10/31 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/10/31 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "getUserByToken",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Msg getMenuListByToken(String token,String sysFlag){
|
||||
try {
|
||||
if(StringUtils.isBlank(token)){
|
||||
return Msg.fail("token不能为空!");
|
||||
}
|
||||
if(StringUtils.isBlank(sysFlag)){
|
||||
return Msg.fail("sysFlag不能为空!");
|
||||
}
|
||||
token = MD5.JM(Base64.decode(token));
|
||||
Cache cacheInfo = CacheManager.getCacheInfo(token);
|
||||
Power_UserVo user = (Power_UserVo) cacheInfo.getValue();
|
||||
if(null != user){
|
||||
List<User_Dept_Menu> menuList = user.getMenuList();
|
||||
List<User_Dept_Menu> list = new ArrayList<>();
|
||||
Set<String> menus = new TreeSet<>();
|
||||
if(null != menuList && !menuList.isEmpty()){
|
||||
for (int i = 0; i < menuList.size(); i++) {
|
||||
String menuSysFlag = menuList.get(i).getSysFlag();
|
||||
if(StringUtils.isNotBlank(menuSysFlag) && menuSysFlag.equals(sysFlag)){
|
||||
list.add(menuList.get(i));
|
||||
if(StringUtils.isNotBlank(menuList.get(i).getMethod())){
|
||||
menus.add(menuList.get(i).getMenuUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
user.setMenuList(list);
|
||||
user.setMenus(menus);
|
||||
UserVo userVo = new UserVo();
|
||||
BeanUtils.copyProperties(user,userVo);
|
||||
//查询用户集合
|
||||
List<User> userList = new ArrayList<>();
|
||||
Integer roleId = userVo.getRoleId();
|
||||
if(roleId == 0){
|
||||
userList = userMapper.selectUserIdAndUserNameList(null);
|
||||
}else{
|
||||
userList = userMapper.selectUserIdAndUserNameList(userVo.getUserId());
|
||||
}
|
||||
//设置用户集合
|
||||
userVo.setUserList(userList);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("user",userVo);
|
||||
}else{
|
||||
return Msg.fail("token已失效");
|
||||
}
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.9
|
||||
* @ProjectName: getMenuByToken
|
||||
* @Description: 根据token获取菜单
|
||||
* @Param 无
|
||||
* @Return getMenuListByToken
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/10/31 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/10/31 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "getMenuByToken",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Msg getMenuByToken(String token,String sysFlag){
|
||||
try {
|
||||
if(StringUtils.isBlank(token)){
|
||||
return Msg.fail("token不能为空!");
|
||||
}
|
||||
if(StringUtils.isBlank(sysFlag)){
|
||||
return Msg.fail("sysFlag不能为空!");
|
||||
}
|
||||
token = MD5.JM(Base64.decode(token));
|
||||
Cache cacheInfo = CacheManager.getCacheInfo(token);
|
||||
Power_UserVo user = (Power_UserVo) cacheInfo.getValue();
|
||||
List<User_Dept_Menu> menuList = user.getMenuList();
|
||||
List<User_Dept_Menu> list = new ArrayList<>();
|
||||
if(null != menuList && !menuList.isEmpty()){
|
||||
for (int i = 0; i < menuList.size(); i++) {
|
||||
String menuSysFlag = menuList.get(i).getSysFlag();
|
||||
if(StringUtils.isNotBlank(menuSysFlag) && menuSysFlag.equals(sysFlag)){
|
||||
list.add(menuList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("list",list);
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.10
|
||||
* @ProjectName: getToken
|
||||
* @Description: 获取token
|
||||
* @Param 无
|
||||
* @Return Msg
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/11/06 10:00
|
||||
* @UpdateUser: 更新者
|
||||
* @UpdateDate: 2019/11/06 10:00
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value = "getToken",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Msg getToken(String userName,String password){
|
||||
try {
|
||||
if(StringUtils.isBlank(userName)){
|
||||
return Msg.fail("用户名不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(password)){
|
||||
return Msg.fail("密码不能为空");
|
||||
}
|
||||
Power_User user = new Power_User();
|
||||
user.setUserName(userName);
|
||||
user.setRemark(password);
|
||||
Power_UserVo userVo = userService.findPowerUserByUserNameAndRemark(user);
|
||||
if(null == userVo){
|
||||
return Msg.fail("用户名或密码不正确");
|
||||
}
|
||||
String date = String.valueOf(DateUtils.getDate());
|
||||
String token = Base64.encode(MD5.KL(date));
|
||||
|
||||
List<Power_Menu> list = null;
|
||||
List<User_Dept_Menu> menuList = new ArrayList<>();
|
||||
Set<String> menus = new TreeSet<>();
|
||||
if (userVo.getRoleId().equals(0) || userVo.getRoleId().equals(-100)) {
|
||||
list = powerMenuService.queryAllPowerMenu(null,userVo.getRoleId());
|
||||
} else {
|
||||
list = powerMenuService.selectUserAndRoleMenuListPower(userVo.getUserId(),null);
|
||||
}
|
||||
if(null != list && !list.isEmpty()){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
User_Dept_Menu deptMenu = new User_Dept_Menu();
|
||||
String menuUrl = list.get(i).getMenuUrl();
|
||||
if(StringUtils.isNotBlank(menuUrl)){
|
||||
BeanUtils.copyProperties(list.get(i),deptMenu);
|
||||
deptMenu.setMethodParent(list.get(i).getParentId());
|
||||
menuList.add(deptMenu);
|
||||
}
|
||||
if(StringUtils.isNotBlank(list.get(i).getMethod())){
|
||||
menus.add(list.get(i).getMenuUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
userVo.setMenuList(menuList);
|
||||
userVo.setMenus(menus);
|
||||
|
||||
//设置科室
|
||||
String power_depts = "";
|
||||
List<Power_Dept> power_depts1 = power_deptService.selectByPrimaryKeys(userVo.getDeptId());
|
||||
for(int j=0;j<power_depts1.size();j++){
|
||||
if(j<power_depts1.size()-1){
|
||||
power_depts += power_depts1.get(j).getDeptName()+",";
|
||||
}else{
|
||||
power_depts += power_depts1.get(j).getDeptName();
|
||||
}
|
||||
}
|
||||
userVo.setRemark(power_depts);
|
||||
//移除缓存
|
||||
CacheManager.removeCacheByObject(userVo);
|
||||
CacheManager.putCache(date,new Cache(date,userVo,TOKEN_EXPIRE_TIME));
|
||||
return Msg.success().add("token",token);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 2.11
|
||||
* @MethodName getUnReadCount
|
||||
* @Description: 根据用户获取未读通知数量
|
||||
* @Param 无
|
||||
* @Returnt Msg
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019-10-17
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019-10-17
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.2.2
|
||||
*/
|
||||
@RequestMapping("notice/getUnReadCount")
|
||||
@ResponseBody
|
||||
public Msg getUnReadCount(Integer userId){
|
||||
try {
|
||||
if(null == userId){
|
||||
return Msg.fail("用户id不能为空");
|
||||
}
|
||||
Power_UserVo userVo = userMapper.selectByPrimaryKey(userId);
|
||||
if(null == userVo){
|
||||
return Msg.fail("用户id不存在");
|
||||
}
|
||||
int unReadCount = noticeService.getUnReadCount(userId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("unReadCount",unReadCount);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.vo.Power_UserVo;
|
||||
import com.manage.vo.User_Dept_Menu;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.jsp.*;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.servlet.jsp.tagext.TagSupport;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/8/14 11:15
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/8/14 11:15
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class HasAnyPermission extends TagSupport {
|
||||
private String permissions;
|
||||
|
||||
public String getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(String permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int doStartTag() throws JspException {
|
||||
HttpSession session = pageContext.getSession();
|
||||
String[] arrPermissions = permissions.split(",");
|
||||
//用户是否分配了权限
|
||||
Power_UserVo user = (Power_UserVo)session.getAttribute("CURRENT_USER");
|
||||
//系统管理员全部放过
|
||||
if(user.getRoleId() == 0){
|
||||
return TagSupport.EVAL_BODY_INCLUDE;
|
||||
}
|
||||
List<User_Dept_Menu> hasPermissions = user.getMenuList();
|
||||
if(null != hasPermissions && !hasPermissions.isEmpty()){
|
||||
for (User_Dept_Menu pm : hasPermissions){
|
||||
if(StringUtils.isNoneBlank(pm.getMenuUrl())){
|
||||
for (String psermission : arrPermissions){
|
||||
//用户分配的权限中,是否包含该权限
|
||||
if (pm.getMenuUrl().equals(psermission)){
|
||||
return TagSupport.EVAL_BODY_INCLUDE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TagSupport.SKIP_BODY;
|
||||
}
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.manage.encrypt.Base64;
|
||||
import com.manage.encrypt.MD5;
|
||||
import com.manage.entity.*;
|
||||
import com.manage.service.*;
|
||||
import com.manage.service.cache.Cache;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.util.*;
|
||||
import com.manage.vo.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
public class LoginController {
|
||||
@Value("${TOKEN_EXPIRE_TIME}")
|
||||
private long TOKEN_EXPIRE_TIME;
|
||||
@Autowired
|
||||
private Power_UserService powerUserService;
|
||||
@Autowired
|
||||
private Power_MenuService powerMenuService;
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
@Autowired
|
||||
private Power_DeptService power_deptService;
|
||||
|
||||
@RequestMapping(value = "login",method = RequestMethod.GET)
|
||||
public String toLogin(){
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "loginDir/login174";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "login",method = RequestMethod.POST)
|
||||
public String login(Power_User powerUser,HttpServletResponse response, HttpServletRequest request){
|
||||
try {
|
||||
Power_UserVo user = powerUserService.findPowerUserByUserNameAndUserPwd(powerUser);
|
||||
//添加进操作日志
|
||||
Power_Log log = new Power_Log();
|
||||
if( user != null){
|
||||
//如处于登录状态,先清除缓存
|
||||
//CacheManager.removeCacheByObject(user);
|
||||
//记住
|
||||
MyCookieUtil.remember(request, response);
|
||||
|
||||
//清除用户登录错误次数缓存
|
||||
CacheManager.clearOnly(powerUser.getUserName());
|
||||
//存session密码置空
|
||||
//是否记住密码功能
|
||||
MyCookieUtil.remember(request, response);
|
||||
//设置token缓存
|
||||
String date = String.valueOf(DateUtils.getDate());
|
||||
String token = Base64.encode(MD5.KL(date));
|
||||
|
||||
|
||||
//查询归属医院
|
||||
/* long start5 = System.currentTimeMillis();
|
||||
Power_User_Dict powerUserDict = powerUserDictMapper.selectDictIdByUserId(user.getUserId());
|
||||
long end5 = System.currentTimeMillis();
|
||||
System.out.println("查询医院时间="+(end5-start5)/1000.0+"s");
|
||||
user.setDictId(powerUserDict.getDictId());*/
|
||||
//科室id科室名
|
||||
ActionScopeUtils.setSessionAttribute("token",token,Integer.valueOf(String.valueOf(TOKEN_EXPIRE_TIME))/1000);
|
||||
|
||||
//设置用户登录次数缓存
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
CacheManager.addloginUserCount(fmt.format(new Date()),user.getUserName());
|
||||
CacheManager.addExcCount("noExc");
|
||||
List<Power_Menu> list = null;
|
||||
List<User_Dept_Menu> menuList = new ArrayList<>();
|
||||
Set<String> menus = new TreeSet<>();
|
||||
if (user.getRoleId().equals(0) || user.getRoleId().equals(-100)) {
|
||||
list = powerMenuService.queryAllPowerMenu(null,user.getRoleId());
|
||||
} else {
|
||||
list = powerMenuService.selectUserAndRoleMenuListPower(user.getUserId(),null);
|
||||
}
|
||||
if(null != list && !list.isEmpty()){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
User_Dept_Menu deptMenu = new User_Dept_Menu();
|
||||
String menuUrl = list.get(i).getMenuUrl();
|
||||
if(StringUtils.isNotBlank(menuUrl)){
|
||||
BeanUtils.copyProperties(list.get(i),deptMenu);
|
||||
deptMenu.setMethodParent(list.get(i).getParentId());
|
||||
menuList.add(deptMenu);
|
||||
}
|
||||
if(StringUtils.isNotBlank(list.get(i).getMethod())){
|
||||
menus.add(list.get(i).getMenuUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
user.setMenuList(menuList);
|
||||
user.setMenus(menus);
|
||||
|
||||
//设置科室
|
||||
String power_depts = "";
|
||||
List<Power_Dept> power_depts1 = power_deptService.selectByPrimaryKeys(user.getDeptId());
|
||||
for(int j=0;j<power_depts1.size();j++){
|
||||
if(j<power_depts1.size()-1){
|
||||
power_depts += power_depts1.get(j).getDeptName()+",";
|
||||
}else{
|
||||
power_depts += power_depts1.get(j).getDeptName();
|
||||
}
|
||||
}
|
||||
user.setRemark(power_depts);
|
||||
|
||||
//设置进缓存
|
||||
CacheManager.putCache(date,new Cache(date,user,TOKEN_EXPIRE_TIME));
|
||||
ActionScopeUtils.setSessionAttribute("CURRENT_USER",user,Integer.valueOf(String.valueOf(TOKEN_EXPIRE_TIME))/1000);
|
||||
return "redirect:gatewayPage";
|
||||
}else{
|
||||
//登录失败
|
||||
Integer wrongNum = 1;
|
||||
Cache cache = CacheManager.getCacheInfo(powerUser.getUserName());
|
||||
if(cache != null){
|
||||
//缓存中错误次数
|
||||
Integer currentNum = (Integer)cache.getValue();
|
||||
//叠加1
|
||||
wrongNum += currentNum;
|
||||
}
|
||||
//先清除后添加缓存
|
||||
CacheManager.clearOnly(powerUser.getUserName());
|
||||
CacheManager.putCache(powerUser.getUserName(),new Cache(powerUser.getUserName(),wrongNum));
|
||||
log.setCreater(powerUser.getUserName());
|
||||
log.setLogTitle("登录");
|
||||
log.setLogContent("用户密码错误");
|
||||
log.setRemark("已错误【"+wrongNum+"】次");
|
||||
logService.insert(log);
|
||||
request.setAttribute("msg", "用户名或密码不正确");
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
CacheManager.addExcCount("exc");
|
||||
}
|
||||
return "loginDir/login";
|
||||
}
|
||||
@RequestMapping("refuse")
|
||||
public String refuse(){
|
||||
return "refuse";
|
||||
}
|
||||
|
||||
|
||||
//获取session所剩时间
|
||||
@RequestMapping(value = "getSessionRemainingTime",method = RequestMethod.GET,produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String getSessionRemainingTime(HttpServletRequest request)throws Exception{
|
||||
long lastAccessTime = 0L;
|
||||
String sessionId = request.getSession().getId();
|
||||
lastAccessTime = (long)request.getSession().getAttribute(sessionId);
|
||||
return JSON.toJSONString(TOKEN_EXPIRE_TIME-(System.currentTimeMillis()-lastAccessTime));
|
||||
}
|
||||
}
|
@ -0,0 +1,346 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.dao.Power_Sys_DictMapper;
|
||||
import com.manage.encrypt.Base64;
|
||||
import com.manage.encrypt.MD5;
|
||||
import com.manage.entity.Power_Log;
|
||||
import com.manage.entity.Power_Menu;
|
||||
import com.manage.entity.Power_Sys_Dict;
|
||||
import com.manage.service.LogService;
|
||||
import com.manage.service.Power_MenuService;
|
||||
import com.manage.service.cache.Cache;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.ipml.PageServiceImpl;
|
||||
import com.manage.service.ipml.Power_NoticeServiceImpl;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.vo.Echarts;
|
||||
import com.manage.vo.Power_UserVo;
|
||||
import com.manage.vo.User_Dept_Menu;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 跳转页面 不做业务处理
|
||||
* @Author: ljx
|
||||
* @Date: 2019/4/16 9:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Controller
|
||||
public class PageController {
|
||||
@Value("${EMRMEDICALRECORD_URLHEAD}")
|
||||
private String EMRMEDICALRECORD_URLHEAD;
|
||||
@Value("${EMRRECORD_URLHEAD}")
|
||||
private String EMRRECORD_URLHEAD;
|
||||
@Value("${EMRAPPLYCOPY_URLHEAD}")
|
||||
private String EMRAPPLYCOPY_URLHEAD;
|
||||
@Value("${EMRFILES_URLHEAD}")
|
||||
private String EMRFILES_URLHEAD;
|
||||
|
||||
@Value("${WEBSOCKET_URLHEAD}")
|
||||
private String WEBSOCKET_URLHEAD;
|
||||
@Value("${STR_SPLIT}")
|
||||
private String STR_SPLIT;
|
||||
@Autowired
|
||||
private Power_NoticeServiceImpl powerNoticeService;
|
||||
@Autowired
|
||||
private PageServiceImpl pageService;
|
||||
@Autowired
|
||||
private Power_Sys_DictMapper sysDictMapper;
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
@Value("${TOKEN_EXPIRE_TIME}")
|
||||
private long TOKEN_EXPIRE_TIME;
|
||||
@Autowired
|
||||
private Power_MenuService powerMenuService;
|
||||
@RequestMapping(value = "logout")
|
||||
public String logout(HttpSession session,String token){
|
||||
try {
|
||||
session.invalidate();
|
||||
token = MD5.JM(Base64.decode(token));
|
||||
Cache cache = CacheManager.getCacheInfo(token);
|
||||
if(cache != null){
|
||||
//CacheManager.removeCacheByObject((Power_UserVo)cache.getValue());
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
CacheManager.addExcCount("exc");
|
||||
}
|
||||
return "redirect:login";
|
||||
}
|
||||
@RequestMapping(value = "index")
|
||||
public String index(Model model,HttpServletRequest request){
|
||||
Power_UserVo user =(Power_UserVo)request.getSession().getAttribute("CURRENT_USER");
|
||||
model.addAttribute("WEBSOCKET_URLHEAD",WEBSOCKET_URLHEAD);
|
||||
model.addAttribute("STR_SPLIT",STR_SPLIT);
|
||||
CacheManager.addExcCount("noExc");
|
||||
Set<String> menus = new TreeSet<>();
|
||||
List<Power_Menu> list = null;
|
||||
if (user.getRoleId().equals(0) || user.getRoleId().equals(-100)) {
|
||||
list = powerMenuService.queryAllPowerMenu(null,user.getRoleId());
|
||||
} else {
|
||||
list = powerMenuService.selectUserAndRoleMenuListPower(user.getUserId(),null);
|
||||
}
|
||||
if(null != list && !list.isEmpty()){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if(StringUtils.isNotBlank(list.get(i).getMethod())){
|
||||
menus.add(list.get(i).getMenuUrl());
|
||||
}
|
||||
}
|
||||
}
|
||||
user.setMenus(menus);
|
||||
return "/loginDir/index";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "gatewayPage")
|
||||
public String register(Model model, HttpServletRequest request,Integer noticeId){
|
||||
model.addAttribute("EMRMEDICALRECORD_URLHEAD",EMRMEDICALRECORD_URLHEAD);
|
||||
|
||||
model.addAttribute("EMRRECORD_URLHEAD",EMRRECORD_URLHEAD);
|
||||
|
||||
model.addAttribute("EMRAPPLYCOPY_URLHEAD",EMRAPPLYCOPY_URLHEAD);
|
||||
|
||||
model.addAttribute("EMRFILES_URLHEAD",EMRFILES_URLHEAD);
|
||||
|
||||
model.addAttribute("WEBSOCKET_URLHEAD",WEBSOCKET_URLHEAD);
|
||||
model.addAttribute("STR_SPLIT",STR_SPLIT);
|
||||
model.addAttribute("flag",noticeId);
|
||||
//登录成功
|
||||
//插入成功日志
|
||||
Power_UserVo powerUser = (Power_UserVo)request.getSession().getAttribute("CURRENT_USER");
|
||||
Power_Log log = new Power_Log();
|
||||
log.setLogTitle("登录");
|
||||
log.setLogContent("用户登录成功");
|
||||
log.setCreater(powerUser.getUserName());
|
||||
logService.insert(log);
|
||||
//修改该通知为已读
|
||||
if(null != noticeId && noticeId != -1){
|
||||
try {
|
||||
powerNoticeService.updateNoticeReadFlag(noticeId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
CacheManager.addExcCount("exc");
|
||||
}
|
||||
}
|
||||
//查询当前用户
|
||||
Power_UserVo user = (Power_UserVo)request.getSession().getAttribute("CURRENT_USER");
|
||||
//查询系统权限
|
||||
List<Power_Sys_Dict> sysList = new ArrayList<>();
|
||||
if(user.getRoleId() == 0){
|
||||
sysList = sysDictMapper.selectSysFlagsByUserId(null,null);
|
||||
}else{
|
||||
sysList = sysDictMapper.selectSysFlagsByUserId(user.getUserId(),user.getRoleId());
|
||||
}
|
||||
int power = 0;
|
||||
int emr_medical_record = 0;
|
||||
int emr_record = 0;
|
||||
int emr_apply_copy = 0;
|
||||
int emr_files = 0;
|
||||
int power1 = 0;
|
||||
int emr_medical_record1 = 0;
|
||||
int emr_record1 = 0;
|
||||
int emr_apply_copy1 = 0;
|
||||
int emr_files1 = 0;
|
||||
if(null != sysList && !sysList.isEmpty()){
|
||||
//获取权限菜单
|
||||
List<User_Dept_Menu> menuList = powerUser.getMenuList();
|
||||
if(null != menuList && !menuList.isEmpty()) {
|
||||
for (User_Dept_Menu menu : menuList) {
|
||||
String sysFlag = menu.getSysFlag();
|
||||
if (StringUtils.isNotBlank(sysFlag)) {
|
||||
if ("power".equals(sysFlag)) {
|
||||
power1 = 1;
|
||||
continue;
|
||||
}
|
||||
if ("emr_medical_record".equals(sysFlag)) {
|
||||
emr_medical_record1 = 1;
|
||||
continue;
|
||||
}
|
||||
if ("emr_record".equals(sysFlag)) {
|
||||
emr_record1 = 1;
|
||||
continue;
|
||||
}
|
||||
if ("emr_apply_copy".equals(sysFlag)) {
|
||||
emr_apply_copy1 = 1;
|
||||
continue;
|
||||
}
|
||||
if ("emr_files".equals(sysFlag)) {
|
||||
emr_files1 = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < sysList.size(); i++) {
|
||||
String sysFlag = sysList.get(i).getSysFlag();
|
||||
if(StringUtils.isNotBlank(sysFlag)){
|
||||
if("power".equals(sysFlag)){
|
||||
power = 1;
|
||||
continue;
|
||||
}
|
||||
if("emr_medical_record".equals(sysFlag)){
|
||||
emr_medical_record = 1;
|
||||
continue;
|
||||
}
|
||||
if("emr_record".equals(sysFlag)){
|
||||
emr_record = 1;
|
||||
continue;
|
||||
}
|
||||
if("emr_apply_copy".equals(sysFlag)){
|
||||
emr_apply_copy = 1;
|
||||
continue;
|
||||
}
|
||||
if("emr_files".equals(sysFlag)){
|
||||
emr_files = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(power == 1 && power1 == 1){
|
||||
power = 1;
|
||||
}else{
|
||||
power = 0;
|
||||
}
|
||||
if(emr_medical_record == 1 && emr_medical_record1 == 1){
|
||||
emr_medical_record = 1;
|
||||
}else{
|
||||
emr_medical_record = 0;
|
||||
}
|
||||
if(emr_record == 1 && emr_record1 == 1){
|
||||
emr_record = 1;
|
||||
}else{
|
||||
emr_record = 0;
|
||||
}
|
||||
if(emr_apply_copy == 1 && emr_apply_copy1 == 1){
|
||||
emr_apply_copy = 1;
|
||||
}else{
|
||||
emr_apply_copy = 0;
|
||||
}
|
||||
if(emr_files == 1 && emr_files1 == 1){
|
||||
emr_files = 1;
|
||||
}else{
|
||||
emr_files = 0;
|
||||
}
|
||||
model.addAttribute("power",power);
|
||||
model.addAttribute("emr_medical_record",emr_medical_record);
|
||||
model.addAttribute("emr_record",emr_record);
|
||||
model.addAttribute("emr_apply_copy",emr_apply_copy);
|
||||
model.addAttribute("emr_files",emr_files);
|
||||
return "/gatewayDir/gatewayIndex";
|
||||
}
|
||||
@RequestMapping(value = "main")
|
||||
public String main(){
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "main";
|
||||
}
|
||||
|
||||
@RequestMapping("getEcharts1")
|
||||
@ResponseBody
|
||||
public Msg getEcharts1(){
|
||||
List<Echarts> list = new ArrayList<>();
|
||||
try {
|
||||
//无异常
|
||||
Integer noExc = CacheManager.getExcCount("noExc");
|
||||
String valueArr1[] = {noExc.toString()};
|
||||
Echarts echarts1 = new Echarts("无异常",null,valueArr1);
|
||||
|
||||
//异常
|
||||
Integer exc = CacheManager.getExcCount("exc");
|
||||
if(null == exc){
|
||||
exc = 0;
|
||||
}
|
||||
String valueArr2[] = {exc.toString()};
|
||||
Echarts echarts2 = new Echarts("异常",null,valueArr2);
|
||||
|
||||
//锁定
|
||||
Integer effectiveCount = pageService.selectEffectiveCount();
|
||||
if(null == effectiveCount){
|
||||
effectiveCount = 0;
|
||||
}
|
||||
String valueArr3[] = {effectiveCount.toString()};
|
||||
Echarts echarts3 = new Echarts("锁定",null,valueArr3);
|
||||
|
||||
list.add(echarts1);
|
||||
list.add(echarts2);
|
||||
list.add(echarts3);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
return Msg.success().add("list",list);
|
||||
}
|
||||
|
||||
@RequestMapping("getEcharts2")
|
||||
@ResponseBody
|
||||
public Msg getEcharts2(){
|
||||
try {
|
||||
Map<String, List> map = pageService.getEcharts2();
|
||||
return Msg.success().add("list",map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("getEcharts3")
|
||||
@ResponseBody
|
||||
public Msg getEcharts3(){
|
||||
try {
|
||||
Map<String, List> map = pageService.getEcharts3();
|
||||
return Msg.success().add("list",map);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("getEcharts4")
|
||||
@ResponseBody
|
||||
public Msg getEcharts4(){
|
||||
try {
|
||||
int cpuCount = pageService.getEcharts4();
|
||||
return Msg.success().add("list",cpuCount);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//返回40
|
||||
@RequestMapping("getEcharts5")
|
||||
@ResponseBody
|
||||
public Msg getEcharts5(){
|
||||
long temperature = 0;
|
||||
try {
|
||||
temperature = pageService.getEcharts5();
|
||||
return Msg.success().add("temperature",temperature);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.success().add("temperature",temperature);
|
||||
}
|
||||
}
|
||||
|
||||
//返回[8,7.8,5.3]
|
||||
@RequestMapping("getEcharts6")
|
||||
@ResponseBody
|
||||
public Msg getEcharts6(){
|
||||
try {
|
||||
List<String> list = pageService.getEcharts6();
|
||||
return Msg.success().add("list",list);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.manage.controller;
|
||||
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/8/13 17:23
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/8/13 17:23
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class PermissionsException extends RuntimeException {
|
||||
public PermissionsException(){
|
||||
}
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.annotation.OptionalLog;
|
||||
import com.manage.annotation.RequiresPermissions;
|
||||
import com.manage.dao.Power_LogMapper;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.LogService;
|
||||
import com.manage.util.ExportExcelUtil;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.util.PageHelper;
|
||||
import com.manage.vo.Power_LogVo;
|
||||
import com.manage.vo.Power_UserVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/7/10 14:35
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/7/10 14:35
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("otherManage/")
|
||||
public class Power_LogController {
|
||||
@Autowired
|
||||
private Power_LogMapper logMapper;
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
/**
|
||||
* @MethodName backupDatabase
|
||||
* @Description: 跳转到备份数据库页面
|
||||
* @Param 无
|
||||
* @Returnt otherManage/backupDatabase
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019-07-10
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019-07-10
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@OptionalLog(module = "查看",methods = "日志管理页面")
|
||||
@RequiresPermissions("/otherManage/backupDatabase")
|
||||
@RequestMapping("backupDatabase")
|
||||
public String backupDatabase(Model model){
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "otherManage/backupDatabase";
|
||||
}
|
||||
|
||||
/**
|
||||
* @MethodName getLogList
|
||||
* @Description: 获取日志数据表
|
||||
* @Param 无
|
||||
* @Returnt
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019-07-10
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019-07-10
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@RequestMapping(value="getLogList")
|
||||
@ResponseBody
|
||||
public PageHelper<Power_LogVo> getLogList(Power_LogVo log, String startTime, String endTime, HttpServletRequest request){
|
||||
PageHelper<Power_LogVo> pageHelper = new PageHelper<Power_LogVo>();
|
||||
try{
|
||||
List<Power_LogVo> logs = logMapper.selectAll(log, startTime, endTime);
|
||||
int total = logMapper.getTotal(log, startTime, endTime);
|
||||
pageHelper.setTotal(total);
|
||||
//匹配权限
|
||||
Power_UserVo user = (Power_UserVo) request.getSession().getAttribute("CURRENT_USER");
|
||||
if(null != logs && !logs.isEmpty()){
|
||||
Set<String> menus = user.getMenus();
|
||||
if(null != menus && !menus.isEmpty()){
|
||||
Integer deleteOper = 0;
|
||||
for(String menu : menus){
|
||||
if(StringUtils.isNotBlank(menu)){
|
||||
if("/otherManage/deleteLogById".equals(menu)){
|
||||
deleteOper = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Power_LogVo obj : logs){
|
||||
obj.setDeleteOper(deleteOper);
|
||||
}
|
||||
}
|
||||
}
|
||||
pageHelper.setRows(logs);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return pageHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @MethodName deleteLogById
|
||||
* @Description: 根据id删除日志
|
||||
* @Param 无
|
||||
* @Returnt
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019-07-10
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019-07-10
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@OptionalLog(module = "删除",methods = "日志管理",fieldName = "logContent",fieldName1="noticeTypeName",tableName = "Power_Log")
|
||||
@RequiresPermissions("/otherManage/deleteLogById")
|
||||
@RequestMapping("deleteLogById/{logId}")
|
||||
@ResponseBody
|
||||
public Msg deleteLogById(@PathVariable("logId")Integer logId){
|
||||
try{
|
||||
logService.deleteLogById(logId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("删除失败,请联系超管!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @MethodName deleteLogByIds
|
||||
* @Description: 根据id集合批量删除日志
|
||||
* @Param 无
|
||||
* @Returnt
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019-07-10
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019-07-10
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@OptionalLog(module = "批量删除",methods = "日志管理")
|
||||
@RequestMapping("deleteLogByIds/{ids}")
|
||||
@RequiresPermissions("/otherManage/deleteLogByIds")
|
||||
@ResponseBody
|
||||
public Msg deleteLogByIds(@PathVariable("ids")String ids){
|
||||
try{
|
||||
String[] idList = ids.split(",");
|
||||
String str = "";
|
||||
for (int i = 0; i < idList.length; i++) {
|
||||
if(StringUtils.isNoneBlank(idList[i])){
|
||||
if(i != idList.length - 1){
|
||||
str += idList[i] + ",";
|
||||
}else{
|
||||
str += idList[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
logService.deleteLogByIds(str);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("删除失败,请联系超管!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @MethodName: exportExcel
|
||||
* @Description: 根据搜索条件导出excel
|
||||
* @Param
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019-06-27
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019-06-27
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@OptionalLog(module = "导出excel",methods = "日志管理")
|
||||
@RequiresPermissions("/otherManage/exportExcel")
|
||||
@RequestMapping(value="exportExcel",produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public void exportExcel(HttpServletResponse response, Power_LogVo log, String startTime, String endTime,String checks){
|
||||
String tableThNames = "操作人,日志主题,日志内容,备注,操作时间,ip地址";
|
||||
String fieldCns = "creater,logTitle,logContent,remark,createDate,ip";
|
||||
List<Power_LogVo> logs = new ArrayList<>();
|
||||
try {
|
||||
if(StringUtils.isNotBlank(checks)){
|
||||
logs = logMapper.selectAllByIds(checks);
|
||||
}else{
|
||||
//构造excel的数据
|
||||
logs = logMapper.selectAll(log, startTime, endTime);
|
||||
}
|
||||
//文件名
|
||||
String fileName = "操作日志导出数据(" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ").xls";
|
||||
//ExportExcelUtil
|
||||
ExportExcelUtil exportExcelUtil = new ExportExcelUtil();
|
||||
//导出excel的操作
|
||||
exportExcelUtil.expordExcel(tableThNames,fieldCns,logs,fileName,response);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.entity.Power_Menu;
|
||||
import com.manage.entity.Power_Menu_User;
|
||||
import com.manage.entity.Power_User;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.Power_MenuService;
|
||||
import com.manage.util.ActionScopeUtils;
|
||||
import com.manage.util.Constant;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.vo.Power_UserVo;
|
||||
import com.manage.vo.User_Dept_Menu;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:hjl
|
||||
* @Date:Creatid in 1:28 2019/4/17
|
||||
* @Description:菜單管理
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("menuPower/")
|
||||
public class Power_MenuController {
|
||||
@Autowired
|
||||
private Power_MenuService powerMenuService;
|
||||
|
||||
/*@RequestMapping("powerMenuList")
|
||||
@ResponseBody
|
||||
public Msg list() {
|
||||
try {
|
||||
List<Power_Menu> list = powerMenuService.queryAllPowerMenu("power");
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("list",list);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}*/
|
||||
|
||||
@RequestMapping("indexMenu")
|
||||
@ResponseBody
|
||||
public Msg indexMenu() {
|
||||
try {
|
||||
Power_UserVo user = (Power_UserVo) ActionScopeUtils.getSessionAttribute( Constant.CURRENT_USER);
|
||||
List<Power_Menu> list = null;
|
||||
if(user.getRoleId().equals(0) || user.getRoleId().equals(-100)){
|
||||
list = powerMenuService.queryAllPowerMenu("power",user.getRoleId());
|
||||
} else{
|
||||
list = powerMenuService.selectUserAndRoleMenuListPower(user.getUserId(),"power");
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("listPower", list);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
|
||||
/*
|
||||
Power_User user = (Power_User) ActionScopeUtils.getSessionAttribute( Constant.CURRENT_USER);
|
||||
List<Power_Menu> list = null;
|
||||
List<Power_Menu_User> listPower = null;
|
||||
if (user.getRoleId().equals(0)) {
|
||||
list = powerMenuService.queryAllPowerMenu();
|
||||
return Msg.success().add("listRole", list);
|
||||
} else if(user.getRoleId().equals(-100)){
|
||||
listPower = powerMenuService.queryPoswerMenuByUserId(user.getUserId());
|
||||
List<Power_Menu_User> indexList = new ArrayList<>();
|
||||
if(null != listPower && !listPower.isEmpty()){
|
||||
for (int i = 0; i < listPower.size(); i++) {
|
||||
if(StringUtils.isBlank(listPower.get(i).getMenuName()) || "菜单管理".equals(listPower.get(i).getMenuName())){
|
||||
indexList.add(listPower.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(null != indexList && !indexList.isEmpty()){
|
||||
for (int i = 0; i < indexList.size(); i++) {
|
||||
for (int j = 0; j < listPower.size(); j++) {
|
||||
if(listPower.get(j).getMenuId() == indexList.get(i).getMenuId()){
|
||||
listPower.remove(indexList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Msg.success().add("listPower", listPower);
|
||||
} else{
|
||||
List<Power_Detailed_Menu> menuList = powerMenuService.queryMenuViewByUserId(user.getUserId());
|
||||
List<Power_Detailed_Menu> indexList = new ArrayList<>();
|
||||
if(null != menuList && !menuList.isEmpty()){
|
||||
for (int i = 0; i < menuList.size(); i++) {
|
||||
if(StringUtils.isBlank(menuList.get(i).getMenuName())){
|
||||
indexList.add(menuList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(null != indexList && !indexList.isEmpty()){
|
||||
for (int i = 0; i < indexList.size(); i++) {
|
||||
for (int j = 0; j < menuList.size(); j++) {
|
||||
if(menuList.get(j).getMenuId() == indexList.get(i).getMenuId()){
|
||||
menuList.remove(indexList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Msg.success().add("listUser", menuList);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,259 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.manage.annotation.RequiresPermissions;
|
||||
import com.manage.dao.Power_MenuMapper;
|
||||
import com.manage.entity.Power_Menu;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.PowerService;
|
||||
import com.manage.service.Power_MenuService;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.vo.Power_Sys_DictVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("menu/")
|
||||
public class Power_MenuManageController {
|
||||
@Autowired
|
||||
Power_MenuService menuService;
|
||||
@Autowired
|
||||
PowerService powerService;
|
||||
@Autowired
|
||||
Power_MenuMapper powerMenuMapper;
|
||||
|
||||
@RequiresPermissions(value="/menu/pageUI")
|
||||
@RequestMapping("pageUI")
|
||||
public String getinmenuListfoById(Model model){
|
||||
return "menu/menuList";
|
||||
}
|
||||
@RequestMapping(value="loadSys",produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String loadSys(){
|
||||
try {
|
||||
List<Power_Sys_DictVo> dicts = powerService.selectAllSys();
|
||||
CacheManager.addExcCount("noExc");
|
||||
return JSON.toJSONString(dicts);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresPermissions(value="/menu/pageUI")
|
||||
@RequestMapping(value = "getMenuList",produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String getMenuList(){
|
||||
try {
|
||||
List<Power_Menu> menus = new ArrayList<>();
|
||||
Power_Menu menu = new Power_Menu();
|
||||
menu.setMenuId(0);
|
||||
menu.setMenuName("菜单列表");
|
||||
menus.add(menu);
|
||||
List<Power_Menu> menus1 = menuService.selectAll(null,null,null);
|
||||
menus.addAll(menus1);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json = mapper.writeValueAsString(menus);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return json;
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "checkMenuName")
|
||||
@ResponseBody
|
||||
public Msg checkMenuName(String sysFlag,String menuName){
|
||||
try {
|
||||
List<Power_Menu> menus = menuService.checkMenuNameBySysId(sysFlag,menuName);
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(null != menus && !menus.isEmpty()){
|
||||
return Msg.fail();
|
||||
}else{
|
||||
return Msg.success();
|
||||
}
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "checkMethodName")
|
||||
@ResponseBody
|
||||
public Msg checkMethodName(Integer parentId,String methodName,String method){
|
||||
try {
|
||||
List<Power_Menu> menus = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(method)){
|
||||
menus = menuService.checkMethodByParentId(parentId, null,method);
|
||||
}else{
|
||||
menus = menuService.checkMethodByParentId(parentId, methodName,null);
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(null != menus && !menus.isEmpty()){
|
||||
return Msg.fail();
|
||||
}else{
|
||||
return Msg.success();
|
||||
}
|
||||
}catch(Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequiresPermissions(value="/menu/update")
|
||||
@RequestMapping(value="update",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Msg addMenu(Power_Menu menu,String sysName){
|
||||
if(StringUtils.isNotBlank(menu.getMenuUrl())){
|
||||
if(!menu.getMenuUrl().contains("/") && !"#".equals(menu.getMenuUrl())){
|
||||
return Msg.fail("菜单地址必须包含斜杠/,建目录必须为单个字符#");
|
||||
}
|
||||
}
|
||||
try {
|
||||
List<Power_Menu> menus = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(menu.getSysFlag())){
|
||||
menus = menuService.checkMenuNameBySysId(menu.getSysFlag(), menu.getMenuName());
|
||||
}
|
||||
if(menu.getMenuId() == null){
|
||||
if(StringUtils.isNoneBlank(menu.getMethod())) {
|
||||
Integer parentId = menu.getParentId();
|
||||
Power_Menu parentMenu = powerMenuMapper.selectByPrimaryKey(parentId);
|
||||
String menuUrl = parentMenu.getMenuUrl();
|
||||
if (StringUtils.isNoneBlank(menuUrl) && menuUrl.contains("/")) {
|
||||
String methodUrl = "";
|
||||
// /user /user/pageUI user/pageUI ../user/pageUI
|
||||
String str1 = "";
|
||||
String str = menuUrl.substring(0, 1);
|
||||
if(menuUrl.length() >= 3){
|
||||
str1 = menuUrl.substring(0, 3);
|
||||
}
|
||||
if("/".equals(str)){
|
||||
menuUrl = menuUrl.substring(1,menuUrl.length());
|
||||
if(StringUtils.isNotBlank(menuUrl)){
|
||||
String[] menuss = menuUrl.split("/");
|
||||
methodUrl = "/" + menuss[0] + "/" + menu.getMethod();
|
||||
}else{
|
||||
methodUrl = "/" + menu.getMethod();
|
||||
}
|
||||
}else if(StringUtils.isNotBlank(str1) && "../".equals(str1)){
|
||||
menuUrl = menuUrl.substring(3,menuUrl.length());
|
||||
if(StringUtils.isNotBlank(menuUrl)){
|
||||
String[] menuss = menuUrl.split("/");
|
||||
methodUrl = "../" + menuss[0] + "/" + menu.getMethod();
|
||||
}else{
|
||||
methodUrl = "../" + menu.getMethod();
|
||||
}
|
||||
}else{
|
||||
String[] menuss = menuUrl.split("/");
|
||||
methodUrl = menuss[0] + "/" + menu.getMethod();
|
||||
}
|
||||
menu.setMenuUrl(methodUrl);
|
||||
}else{
|
||||
return Msg.fail("父级菜单url地址格式不正确,正确示例:/user或/user/pageUI!");
|
||||
}
|
||||
List<Power_Menu> checkMethodNames = menuService.checkMethodByParentId(menu.getParentId(), menu.getMenuName(),null);
|
||||
List<Power_Menu> checkMethods = menuService.checkMethodByParentId(menu.getParentId(),null,menu.getMethod());
|
||||
if(null != checkMethodNames && !checkMethodNames.isEmpty()){
|
||||
return Msg.fail("功能名称不能重复!");
|
||||
}
|
||||
if(null != checkMethods && !checkMethods.isEmpty()){
|
||||
return Msg.fail("功能方法已存在!");
|
||||
}
|
||||
}else{
|
||||
if(null != menus && !menus.isEmpty()){
|
||||
return Msg.fail("菜单名不能重复!");
|
||||
}
|
||||
}
|
||||
menuService.addMenu(menu,sysName);
|
||||
}else{
|
||||
if(StringUtils.isNoneBlank(menu.getMethod())) {
|
||||
Integer parentId = menu.getParentId();
|
||||
Power_Menu parentMenu = powerMenuMapper.selectByPrimaryKey(parentId);
|
||||
String menuUrl = parentMenu.getMenuUrl();
|
||||
if (StringUtils.isNoneBlank(menuUrl) && menuUrl.contains("/")) {
|
||||
String methodUrl = "";
|
||||
// /user /user/pageUI user/pageUI ../user/pageUI
|
||||
String str1 = "";
|
||||
String str = menuUrl.substring(0, 1);
|
||||
if(menuUrl.length() >= 3){
|
||||
str1 = menuUrl.substring(0, 3);
|
||||
}
|
||||
if("/".equals(str)){
|
||||
menuUrl = menuUrl.substring(1,menuUrl.length());
|
||||
if(StringUtils.isNotBlank(menuUrl)){
|
||||
String[] menuss = menuUrl.split("/");
|
||||
methodUrl = "/" + menuss[0] + "/" + menu.getMethod();
|
||||
}else{
|
||||
methodUrl = "/" + menu.getMethod();
|
||||
}
|
||||
}else if(StringUtils.isNotBlank(str1) && "../".equals(str1)){
|
||||
menuUrl = menuUrl.substring(3,menuUrl.length());
|
||||
if(StringUtils.isNotBlank(menuUrl)){
|
||||
String[] menuss = menuUrl.split("/");
|
||||
methodUrl = "../" + menuss[0] + "/" + menu.getMethod();
|
||||
}else{
|
||||
methodUrl = "../" + menu.getMethod();
|
||||
}
|
||||
}else{
|
||||
String[] menuss = menuUrl.split("/");
|
||||
methodUrl = menuss[0] + "/" + menu.getMethod();
|
||||
}
|
||||
menu.setMenuUrl(methodUrl);
|
||||
}else{
|
||||
return Msg.fail("父级菜单url地址格式不正确,正确示例:/user或/user/pageUI!");
|
||||
}
|
||||
List<Power_Menu> checkMethodNames = menuService.checkMethodByParentId(menu.getParentId(), menu.getMenuName(),null);
|
||||
List<Power_Menu> checkMethods = menuService.checkMethodByParentId(menu.getParentId(),null,menu.getMethod());
|
||||
if(null != checkMethodNames && !checkMethodNames.isEmpty() && !checkMethodNames.get(0).getMenuId().equals(menu.getMenuId())){
|
||||
return Msg.fail("方法名不能重复!");
|
||||
}
|
||||
if(null != checkMethods && !checkMethods.isEmpty() && !checkMethods.get(0).getMenuId().equals(menu.getMenuId())){
|
||||
return Msg.fail("功能方法已存在!");
|
||||
}
|
||||
}else{
|
||||
if(null != menus && !menus.isEmpty() && !menus.get(0).getMenuId().equals(menu.getMenuId())){
|
||||
return Msg.fail("菜单名不能重复!");
|
||||
}
|
||||
}
|
||||
menuService.updateMenu(menu,sysName);
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("保存失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresPermissions(value="/menu/delete")
|
||||
@RequestMapping("delete/{menuId}")
|
||||
@ResponseBody
|
||||
public Msg delMenu(@PathVariable("menuId")Integer menuId){
|
||||
try {
|
||||
menuService.deleteMenuByMenuId(menuId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,276 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.manage.annotation.OptionalLog;
|
||||
import com.manage.dao.Power_NoticeMapper;
|
||||
import com.manage.entity.Power_Notice;
|
||||
import com.manage.entity.Power_User;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.ipml.Power_NoticeServiceImpl;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.util.PageHelper;
|
||||
import com.manage.vo.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("notice/")
|
||||
public class Power_NoticeController {
|
||||
@Autowired
|
||||
private Power_NoticeServiceImpl noticeService;
|
||||
@Autowired
|
||||
private Power_NoticeMapper noticeMapper;
|
||||
@OptionalLog(module = "查看",methods = "通知管理页面")
|
||||
@RequestMapping(value = "pageUI")
|
||||
public String notice(HttpServletRequest request, Model model){
|
||||
noticeService.loadSys(request,model);
|
||||
model.addAttribute("user",(Power_User)request.getSession().getAttribute("CURRENT_USER"));
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "/noticeDir/noticePage";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "selectAll",produces = "application/json; charset=utf-8")
|
||||
@ResponseBody
|
||||
public PageHelper<Power_NoticeVo> selectAll(Power_NoticeVo notice, HttpServletRequest request) {
|
||||
PageHelper<Power_NoticeVo>pageHelper = new PageHelper<Power_NoticeVo>();
|
||||
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
|
||||
List<Power_NoticeVo>power_notices = new ArrayList<Power_NoticeVo>();
|
||||
List<Power_NoticeVo> getTatal = new ArrayList<Power_NoticeVo>();
|
||||
try {
|
||||
/*if(user.getRoleId() == 0){
|
||||
power_notices = this.noticeMapper.selectSysByAdmin(null,null,notice);
|
||||
}else{
|
||||
power_notices = this.noticeMapper.selectSysByAdmin(user.getRoleId(),user.getUserId(),notice);
|
||||
}*/
|
||||
if(user.getRoleId() == 0){
|
||||
getTatal = this.noticeMapper.getTotal(null,null,notice);
|
||||
power_notices = this.noticeMapper.selectALlByPower(null,null,notice);
|
||||
}else{
|
||||
getTatal = this.noticeMapper.getTotal(user.getRoleId(),user.getUserId(),notice);
|
||||
power_notices = this.noticeMapper.selectALlByPower(user.getRoleId(),user.getUserId(),notice);
|
||||
}
|
||||
pageHelper.setTotal(getTatal.size());
|
||||
//查询当前页实体对象
|
||||
pageHelper.setRows(power_notices);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return pageHelper;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<Power_Notice> putChildren(List<Power_Notice> moduleList, Power_NoticeVo notice,Power_User user) {
|
||||
if (moduleList.size() > 0) {
|
||||
for (Power_Notice mod2 : moduleList) {
|
||||
HashMap param = new HashMap();
|
||||
notice.setParentId(mod2.getNoticeId());
|
||||
List<Power_Notice> res2 = new ArrayList<>();
|
||||
if(user.getRoleId() == -100 || user.getRoleId() == 0){
|
||||
res2 = this.noticeMapper.selectNoticeListByParentId(notice,null);
|
||||
}else{
|
||||
res2 = this.noticeMapper.selectNoticeListByParentId(notice,user.getUserId());
|
||||
}
|
||||
if (res2.size() > 0) {
|
||||
res2 = putChildren(res2,notice,user);
|
||||
}
|
||||
mod2.setChildren(res2);
|
||||
}
|
||||
}
|
||||
return moduleList;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getNoticeTypeTree",produces = {"text/json;charset=UTF-8"})
|
||||
@ResponseBody
|
||||
public String getNoticeTypeTree(){
|
||||
try {
|
||||
List<PowerTree> treeList = noticeService.getNoticeTypeTree();
|
||||
CacheManager.addExcCount("noExc");
|
||||
return JSON.toJSONString(treeList);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "checkTypeSysFlagOrTypeSysName")
|
||||
@ResponseBody
|
||||
public Msg checkTypeSysFlag(String noticeTypeFlag,String noticeTypeName){
|
||||
try {
|
||||
if(StringUtils.isNoneBlank(noticeTypeFlag) || StringUtils.isNotBlank(noticeTypeName)) {
|
||||
Power_Notice powerNotice = noticeService.checkTypeSysFlagOrTypeSysName(noticeTypeFlag, noticeTypeName);
|
||||
CacheManager.addExcCount("noExc");
|
||||
if (null != powerNotice) {
|
||||
return Msg.fail();
|
||||
} else {
|
||||
return Msg.success();
|
||||
}
|
||||
}else{
|
||||
return Msg.fail("查询出错,请联系系统管理员!");
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("查询出错,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "update")
|
||||
@ResponseBody
|
||||
public Msg udpate(Power_Notice powerNotice,HttpServletRequest request){
|
||||
try {
|
||||
//保存类别
|
||||
if(StringUtils.isNotBlank(powerNotice.getNoticeTypeFlag())){
|
||||
//验证用户名
|
||||
Power_Notice typeNotice = noticeService.checkTypeSysFlagOrTypeSysName(powerNotice.getNoticeTypeFlag(), null);
|
||||
Power_Notice nameNotice = noticeService.checkTypeSysFlagOrTypeSysName(null,powerNotice.getNoticeTypeName());
|
||||
//添加类别
|
||||
if (null == powerNotice.getNoticeId()) {
|
||||
if(null != typeNotice){
|
||||
return Msg.fail("类别标志已存在!");
|
||||
}
|
||||
if(null != nameNotice){
|
||||
return Msg.fail("类别名称已存在!");
|
||||
}
|
||||
noticeService.update(powerNotice,request);
|
||||
} else {
|
||||
//修改类别
|
||||
if(null != typeNotice && !typeNotice.getNoticeId().equals(powerNotice.getNoticeId())){
|
||||
return Msg.fail("类别标志已存在!");
|
||||
}
|
||||
if(null != nameNotice && !nameNotice.getNoticeId().equals(powerNotice.getNoticeId())){
|
||||
return Msg.fail("类别名称已存在!");
|
||||
}
|
||||
noticeService.update(powerNotice,request);
|
||||
}
|
||||
}else{
|
||||
//保存通知
|
||||
noticeService.update(powerNotice,request);
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
CacheManager.addExcCount("exc");
|
||||
return Msg.fail("查询出错,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
@OptionalLog(module = "删除",methods = "通知管理",fieldName = "noticeContent",fieldName1="noticeTypeName",tableName = "power_notice")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public Msg delete(Integer noticeId){
|
||||
try {
|
||||
noticeService.delete(noticeId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************通知操作***************************************************/
|
||||
@RequestMapping(value = "getUserNameListByNoticeTypeId")
|
||||
@ResponseBody
|
||||
public Msg getUserNameListByNoticeTypeId(Integer noticeTypeId, HttpServletRequest request){
|
||||
try {
|
||||
List<Power_UserVo> userList = noticeService.getUserNameListByNoticeTypeId(noticeTypeId, request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("userList",userList);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("查询出错,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "selectNoticeByNoticeId")
|
||||
@ResponseBody
|
||||
public Msg selectNoticeByNoticeId(Integer noticeId){
|
||||
try {
|
||||
Power_Notice powerNotice = noticeMapper.selectByPrimaryKey(noticeId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("powerNotice",powerNotice);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("查询出错,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
@OptionalLog(module = "导出excel",methods = "通知管理")
|
||||
@RequestMapping(value = "export")
|
||||
@ResponseBody
|
||||
public void export(Power_NoticeVo powerNoticeVo,String noticeIds, HttpServletResponse response, HttpServletRequest request){
|
||||
try {
|
||||
noticeService.export(powerNoticeVo,noticeIds,response,request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateNoticeReadFlag")
|
||||
@ResponseBody
|
||||
public Msg updateNoticeReadFlag(Integer noticeId){
|
||||
try {
|
||||
noticeService.updateNoticeReadFlag(noticeId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("修改出错了,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @MethodName getUnReadCount
|
||||
* @Description: 根据用户获取未读通知数量
|
||||
* @Param 无
|
||||
* @Returnt Msg
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019-10-17
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019-10-17
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.2.2
|
||||
*/
|
||||
@RequestMapping("getUnReadCount")
|
||||
@ResponseBody
|
||||
public Msg getUnReadCount(HttpServletRequest request){
|
||||
try {
|
||||
//获取登录者信息
|
||||
Power_UserVo user = (Power_UserVo)request.getSession().getAttribute("CURRENT_USER");
|
||||
Integer userId = null;
|
||||
//系统管理员userId为null,非系统管理员传入userId
|
||||
if(user.getRoleId() != 0){
|
||||
userId = user.getRoleId();
|
||||
}
|
||||
int unReadCount = noticeService.getUnReadCount(userId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("unReadCount",unReadCount);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,392 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.annotation.RequiresPermissions;
|
||||
import com.manage.dao.Power_Sys_DictMapper;
|
||||
import com.manage.entity.Power_Sys_Dict;
|
||||
import com.manage.entity.Power_User;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.Power_DeptService;
|
||||
import com.manage.service.Power_Sys_DictService;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.util.PageHelper;
|
||||
import com.manage.vo.Power_DeptVo;
|
||||
import com.manage.vo.Power_Sys_DictVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/8/29 13:45
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/8/29 13:45
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dict")
|
||||
public class Power_Sys_DictController {
|
||||
@Autowired
|
||||
Power_Sys_DictService powerSysDictService;
|
||||
@Autowired
|
||||
Power_DeptService deptService;
|
||||
@Autowired
|
||||
Power_Sys_DictMapper sysDictMapper;
|
||||
/**
|
||||
* @Date 2019-5-5
|
||||
* @Author ly
|
||||
* @Description 返回页面
|
||||
* */
|
||||
@RequiresPermissions(value="/dict/pageUI")
|
||||
@RequestMapping("/pageUI")
|
||||
public String pageUI(){
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "dictDir/dict";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/selectHosList")
|
||||
@ResponseBody
|
||||
public List<Power_Sys_Dict> selectHosList(HttpServletRequest request){
|
||||
try {
|
||||
List<Power_Sys_Dict> power_sys_dicts = powerSysDictService.selectHosList(request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return power_sys_dicts;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/selectList")
|
||||
@ResponseBody
|
||||
public List<Power_Sys_Dict> selectList(){
|
||||
try {
|
||||
List<Power_Sys_Dict> power_sys_dicts = powerSysDictService.selectList();
|
||||
CacheManager.addExcCount("noExc");
|
||||
return power_sys_dicts;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/selectDict")
|
||||
@ResponseBody
|
||||
public Power_Sys_Dict selectDict(Integer dictId){
|
||||
try {
|
||||
Power_Sys_Dict power_sys_dict = powerSysDictService.selectByPrimaryKey(dictId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return power_sys_dict;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@RequestMapping("/checkHospitalName")
|
||||
@ResponseBody
|
||||
public Msg checkHospitalName(String hospitalName){
|
||||
try {
|
||||
Power_Sys_DictVo dictVo = powerSysDictService.checkHospitalName(hospitalName);
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(dictVo != null){
|
||||
return Msg.fail("医院名称已存在");
|
||||
}else{
|
||||
return Msg.success();
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("验证失败,请联系系统管理员");
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresPermissions(value="/dict/add")
|
||||
@RequestMapping("/add")
|
||||
@ResponseBody
|
||||
public Msg add(Power_Sys_DictVo powerSysDict, HttpServletRequest request){
|
||||
try {
|
||||
if(powerSysDict.getDictId() == null){
|
||||
//添加医院
|
||||
if(StringUtils.isNoneBlank(powerSysDict.getHospitalName())){
|
||||
Power_Sys_DictVo dictVo = powerSysDictService.checkHospitalName(powerSysDict.getHospitalName());
|
||||
if(dictVo != null){
|
||||
return Msg.fail("医院名称不能重复!");
|
||||
}
|
||||
powerSysDictService.insertSelective(powerSysDict,request);
|
||||
Integer dictId = powerSysDict.getDictId();
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("dictId",dictId);
|
||||
}else{
|
||||
//添加系统
|
||||
String deptIds = powerSysDict.getDeptIds();
|
||||
if(StringUtils.isBlank(deptIds)){
|
||||
deptIds = "-999";
|
||||
}
|
||||
if(!deptIds.contains(",")){
|
||||
List<Power_Sys_Dict> deptBySysFlagList = sysDictMapper.selectDeptIdByParentIdAndSysFlag(powerSysDict.getParentId(), powerSysDict.getSysFlag(),deptIds);
|
||||
if(null != deptBySysFlagList && !deptBySysFlagList.isEmpty()){
|
||||
return Msg.fail("系统标识已存在!");
|
||||
}
|
||||
}
|
||||
/*List<Power_Sys_Dict> dicts = powerSysDictService.checkSysFlagOrSysNameByDeptIds(powerSysDict.getSysFlag(), powerSysDict.getSysName(), deptIds);
|
||||
if(null != dicts && !dicts.isEmpty()) {
|
||||
if (StringUtils.isNoneBlank(powerSysDict.getSysFlag())) {
|
||||
return Msg.fail("系统标识已存在!");
|
||||
} else {
|
||||
return Msg.fail("系统名称已存在!");
|
||||
}
|
||||
}*/
|
||||
if(StringUtils.isNoneBlank(deptIds) && deptIds.contains(",")){
|
||||
int count = powerSysDictService.simpleInsertDict(powerSysDict, deptIds, request);
|
||||
if(count == 0){
|
||||
return Msg.fail("系统已存在!");
|
||||
}else{
|
||||
int dictLastId = sysDictMapper.selectLastDict();
|
||||
powerSysDict.setDictId(dictLastId);
|
||||
}
|
||||
}else{
|
||||
powerSysDict.setDeptId(Integer.valueOf(deptIds));
|
||||
powerSysDictService.insertSelective(powerSysDict,request);
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("dictId",powerSysDict.getDictId());
|
||||
}
|
||||
}else{
|
||||
//修改
|
||||
if(StringUtils.isNoneBlank(powerSysDict.getHospitalName())){
|
||||
//修改医院信息
|
||||
Power_Sys_DictVo dictVo = powerSysDictService.checkHospitalName(powerSysDict.getHospitalName());
|
||||
if(dictVo != null && dictVo.getDictId() != powerSysDict.getDictId()){
|
||||
return Msg.fail("医院名称已存在!");
|
||||
}else{
|
||||
powerSysDictService.updateByPrimaryKeySelective(powerSysDict,request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("dictId",powerSysDict.getDictId());
|
||||
}
|
||||
}else{
|
||||
//修改系统信息
|
||||
Integer deptId = powerSysDict.getDeptId();
|
||||
if(null == deptId){
|
||||
deptId = -999;
|
||||
}
|
||||
List<Power_Sys_Dict> flagExists = powerSysDictService.checkSysFlagOrSysNameByDeptId(powerSysDict.getSysFlag(), null, deptId.toString());
|
||||
if(null != flagExists && !flagExists.isEmpty()) {
|
||||
//判断是否包含在这个集合里
|
||||
Boolean flagExist = false;
|
||||
for (int i = 0; i < flagExists.size(); i++) {
|
||||
if(!flagExists.get(i).getDictId().equals(powerSysDict.getDictId())){
|
||||
flagExist = true;
|
||||
}
|
||||
}
|
||||
if(flagExist){
|
||||
return Msg.fail("系统标识已存在!");
|
||||
}
|
||||
}
|
||||
//修改系统信息
|
||||
List<Power_Sys_Dict> sysNameExists = powerSysDictService.checkSysFlagOrSysNameByDeptId(null, powerSysDict.getSysName(), deptId.toString());
|
||||
if(null != sysNameExists && !sysNameExists.isEmpty()) {
|
||||
//判断是否包含在这个集合里
|
||||
Boolean sysNameExist = false;
|
||||
for (int i = 0; i < sysNameExists.size(); i++) {
|
||||
if(!sysNameExists.get(i).getDictId().equals(powerSysDict.getDictId())){
|
||||
sysNameExist = true;
|
||||
}
|
||||
}
|
||||
if(sysNameExist){
|
||||
return Msg.fail("系统名称已存在!");
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNoneBlank(powerSysDict.getSysType()) && "权限系统".equals(powerSysDict.getSysType())){
|
||||
powerSysDict.setDeptId(null);
|
||||
|
||||
}else{
|
||||
//计算出科室减少部分批量删除,增加部分批量增加,重叠部分批量修改
|
||||
}
|
||||
powerSysDictService.updateByPrimaryKeySelective(powerSysDict,request);
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("dictId",powerSysDict.getDictId());
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("添加失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
@RequiresPermissions(value="/dict/update")
|
||||
@RequestMapping("/update")
|
||||
@ResponseBody
|
||||
public Msg update(@RequestBody Power_Sys_Dict powerSysDict, HttpServletRequest request){
|
||||
try {
|
||||
powerSysDictService.updateByPrimaryKeySelective(powerSysDict,request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("更新失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
@RequiresPermissions(value="/dict/delete")
|
||||
@RequestMapping("/delete")
|
||||
@ResponseBody
|
||||
public Msg delete(Integer dictId){
|
||||
try {
|
||||
powerSysDictService.deleteByPrimaryKey(dictId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("更新失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
@RequestMapping("/selectType")
|
||||
@ResponseBody
|
||||
public List<Power_Sys_DictVo> selectType(){
|
||||
try {
|
||||
List<Power_Sys_DictVo> power_sys_dictVos = powerSysDictService.selectSysType();
|
||||
CacheManager.addExcCount("noExc");
|
||||
return power_sys_dictVos;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@RequestMapping("/export")
|
||||
public void download(HttpServletResponse response){
|
||||
try {
|
||||
powerSysDictService.export(response);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/getHospitalByParentId")
|
||||
@ResponseBody
|
||||
public Msg getHospitalByParentId(Integer dictId){
|
||||
try {
|
||||
Power_Sys_DictVo powerSysExsit = powerSysDictService.getHospitalByParentId(dictId, "权限系统");
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(null != powerSysExsit){
|
||||
return Msg.fail();
|
||||
}else{
|
||||
return Msg.success();
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("查询失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/dictManagePage")
|
||||
public String dictManagePage(Integer level, String operFlag, Integer selfId, Integer deptId, Model model, HttpServletRequest request){
|
||||
try {
|
||||
Power_Sys_DictVo hospital = new Power_Sys_DictVo();
|
||||
if(null != selfId && level != 0){
|
||||
hospital = powerSysDictService.selectByPrimaryKey(selfId);
|
||||
//加载节点信息
|
||||
}
|
||||
//按医院查询科室集合
|
||||
if(StringUtils.isNoneBlank(operFlag) && "edit".equals(operFlag)){
|
||||
if(level != null && level > 0){
|
||||
level -= 1;
|
||||
}
|
||||
}
|
||||
model.addAttribute("hospital",hospital);
|
||||
if(selfId != null && level != 0){
|
||||
//加载系统分类
|
||||
List<String> sysTypes = new ArrayList();
|
||||
|
||||
Power_Sys_DictVo dict = new Power_Sys_DictVo();
|
||||
if(!hospital.getDictId().equals(hospital.getParentId()) && StringUtils.isNoneBlank(operFlag) && "edit".equals(operFlag)){
|
||||
dict = hospital;
|
||||
model.addAttribute("dict",dict);
|
||||
}
|
||||
if(level != 0 && selfId >= 0 || selfId == -100){
|
||||
//权限系统是否存在,不存在才加载
|
||||
Power_Sys_DictVo powerSysExsit = powerSysDictService.getHospitalByParentId(selfId, "权限系统");
|
||||
if(null == powerSysExsit && level != 2 || "权限系统".equals(hospital.getSysType())){
|
||||
sysTypes.add("权限系统");
|
||||
}
|
||||
}
|
||||
//权限系统、病案管理系统、病案归档系统、复印预约系统、科研系统、其它
|
||||
sysTypes.add("档案管理系统");
|
||||
sysTypes.add("档案归档系统");
|
||||
sysTypes.add("复印预约系统");
|
||||
sysTypes.add("科研系统");
|
||||
sysTypes.add("其它");
|
||||
model.addAttribute("sysTypes",sysTypes);
|
||||
if(hospital != null){
|
||||
selfId = hospital.getHospitalId();
|
||||
}
|
||||
List<Power_DeptVo> depts = deptService.selectDeptByDictId(selfId,dict.getSysFlag());
|
||||
model.addAttribute("depts",depts);
|
||||
}
|
||||
//加载医院列表
|
||||
List<Power_Sys_Dict> hospitals = powerSysDictService.selectHosList(request);
|
||||
model.addAttribute("hospitals",hospitals);
|
||||
//节点层级
|
||||
model.addAttribute("level",level);
|
||||
//加载角色id,系统管理员可编辑
|
||||
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
|
||||
model.addAttribute("user",user);
|
||||
model.addAttribute("operFlag",operFlag);
|
||||
if(null != deptId){
|
||||
deptId -= deptId*2;
|
||||
}
|
||||
model.addAttribute("deptId",deptId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "dictDir/dictManageIframe";
|
||||
}
|
||||
|
||||
@RequestMapping("/checkSysFlagOrSysNameByDeptId")
|
||||
@ResponseBody
|
||||
public Msg checkSysFlagOrSysNameByDeptId(String sysFlag,String sysName,String deptIds){
|
||||
try {
|
||||
if(StringUtils.isBlank(deptIds)){
|
||||
deptIds = "-999";
|
||||
}
|
||||
List<Power_Sys_Dict> dicts = powerSysDictService.checkSysFlagOrSysNameByDeptId(sysFlag, sysName, deptIds);
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(null != dicts && !dicts.isEmpty()){
|
||||
if(StringUtils.isNoneBlank(sysFlag)){
|
||||
return Msg.fail("系统标识已存在!");
|
||||
}else{
|
||||
return Msg.fail("系统名称已存在!");
|
||||
}
|
||||
}else{
|
||||
return Msg.success();
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("验证失败,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,314 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.annotation.OptionalLog;
|
||||
import com.manage.annotation.RequiresPermissions;
|
||||
import com.manage.entity.Power_Role;
|
||||
import com.manage.entity.Power_User;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.Power_RoleService;
|
||||
import com.manage.service.ImportExcel.ImportExcelUtil;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.util.PageHelper;
|
||||
import com.manage.vo.ImportExcelEntity;
|
||||
import com.manage.vo.Power_RoleVo;
|
||||
import com.manage.vo.Power_UserVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.multipart.MultipartResolver;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author:ly
|
||||
* @Date:Creatid in 10:10 2019/4/28
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/role")
|
||||
public class RoleController {
|
||||
@Autowired
|
||||
Power_RoleService powerRoleService;
|
||||
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 分页
|
||||
* */
|
||||
@RequiresPermissions(value="/role/pageUI")
|
||||
@RequestMapping("/pageList")
|
||||
@ResponseBody
|
||||
public PageHelper<Power_RoleVo> list(Power_RoleVo powerRole,HttpServletRequest request){
|
||||
PageHelper<Power_RoleVo>pageHelper = new PageHelper<Power_RoleVo>();
|
||||
try {
|
||||
//统计总记录数
|
||||
int total = powerRoleService.getTotal(powerRole,request);
|
||||
pageHelper.setTotal(total);
|
||||
//查询当前页实体对象
|
||||
List<Power_RoleVo> list = powerRoleService.findSomeByMore(powerRole,request);
|
||||
pageHelper.setRows(list);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return pageHelper;
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 返回页面
|
||||
* */
|
||||
@OptionalLog(module = "查看",methods = "角色管理页面")
|
||||
@RequiresPermissions(value="/role/pageUI")
|
||||
@RequestMapping("/pageUI")
|
||||
public String pageUI(){
|
||||
CacheManager.addExcCount("noExc");
|
||||
return "roleDir/role";
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2019-08-02
|
||||
* @Author zengwenhe
|
||||
* @Description 验证角色名是否重复
|
||||
* */
|
||||
@RequestMapping("/checkRoleName")
|
||||
@ResponseBody
|
||||
public Msg checkRoleName(String roleName){
|
||||
try {
|
||||
Power_Role role = powerRoleService.checkRoleName(roleName);
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(null != role){
|
||||
return Msg.fail("角色名已存在!");
|
||||
}else{
|
||||
return Msg.success();
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("验证角色名出错了,请联系系统管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 新增角色
|
||||
* */
|
||||
@OptionalLog(module = "新增",methods = "角色管理",fieldName = "roleName")
|
||||
@RequiresPermissions(value="/role/add")
|
||||
@RequestMapping("/add")
|
||||
@ResponseBody
|
||||
public Msg add(Power_Role powerRole){
|
||||
try {
|
||||
Power_Role role = powerRoleService.checkRoleName(powerRole.getRoleName());
|
||||
if(null != role){
|
||||
return Msg.fail("角色名不能重复!");
|
||||
}else{
|
||||
powerRoleService.insertSelective(powerRole);
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();;
|
||||
return Msg.fail("新增失败,请联系系统管理员!");
|
||||
}
|
||||
return Msg.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 更新角色
|
||||
* */
|
||||
@OptionalLog(module = "修改",methods = "角色管理",fieldName = "roleName")
|
||||
@RequiresPermissions(value="/role/update")
|
||||
@RequestMapping("/update")
|
||||
@ResponseBody
|
||||
public Msg update(Power_Role powerRole,HttpServletRequest request){
|
||||
try {
|
||||
Power_Role role = powerRoleService.checkRoleName(powerRole.getRoleName());
|
||||
if(null != role && !role.getRoleId().equals(powerRole.getRoleId())){
|
||||
return Msg.fail("角色名不能重复!");
|
||||
}else{
|
||||
powerRoleService.updateByPrimaryKeySelective(powerRole,request);
|
||||
}
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail("更新失败,请联系系统管理员!");
|
||||
}
|
||||
return Msg.success();
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 删除角色
|
||||
* */
|
||||
@OptionalLog(module = "删除",methods = "角色管理",fieldName = "roleName",tableName = "power_role")
|
||||
@RequiresPermissions(value="/role/delete")
|
||||
@RequestMapping("/delete")
|
||||
@ResponseBody
|
||||
public Msg delete(Integer roleId){
|
||||
try {
|
||||
powerRoleService.deleteByPrimaryKey(roleId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success();
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return Msg.fail();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 查询角色
|
||||
* */
|
||||
@RequestMapping("/selectRole")
|
||||
@ResponseBody
|
||||
public Power_Role selectRole(Integer roleId){
|
||||
try {
|
||||
Power_Role powerRole = powerRoleService.selectByPrimaryKey(roleId);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return powerRole;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-25
|
||||
* @Author ly
|
||||
* @Description 导出Excel
|
||||
* */
|
||||
@OptionalLog(module = "导出excel",methods = "角色管理")
|
||||
@RequiresPermissions(value="/role/export")
|
||||
@RequestMapping("/export")
|
||||
public void export(Power_RoleVo powerRole, HttpServletResponse response, HttpServletRequest request){
|
||||
try {
|
||||
powerRoleService.export(powerRole,response,request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @Date 2019-4-30
|
||||
* @Author ly
|
||||
* @Description 查询角色列表
|
||||
* */
|
||||
@RequestMapping("/selectList")
|
||||
@ResponseBody
|
||||
public List<Power_RoleVo> selectList(HttpServletRequest request){
|
||||
try {
|
||||
List<Power_RoleVo> power_roles = powerRoleService.selectListByPower(request);
|
||||
CacheManager.addExcCount("noExc");
|
||||
return power_roles;
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Date 2019-10-11
|
||||
* @Author zengwh
|
||||
* @Description 导入excel
|
||||
* */
|
||||
@OptionalLog(module = "导入excel",methods = "角色管理")
|
||||
@RequiresPermissions(value="/role/importExcel")
|
||||
@RequestMapping(value="/importExcel",method = {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> importExcel(HttpServletRequest request){
|
||||
OutputStream os = null;
|
||||
HttpHeaders responseHeaders = new HttpHeaders();
|
||||
responseHeaders.setContentType(new MediaType("text","html",Charset.forName("UTF-8")));
|
||||
try {
|
||||
//读取文件
|
||||
MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
|
||||
MultipartHttpServletRequest multipartRequest = resolver.resolveMultipart(request);
|
||||
MultipartFile multipartFile = multipartRequest.getFile("upfile");
|
||||
//属性名
|
||||
String[] fieldNames = {"roleName","remark","showRecord","downloadRecord","effective"};
|
||||
//判断集中类中的方法名
|
||||
String[] judgeMethods = {"judgeRoleName","judgeRemark","judgeShowRecord","judgeDownloadRecord","convertEffective"};
|
||||
//导入excel的操作
|
||||
Power_Role role = new Power_Role();
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Power_UserVo user = (Power_UserVo)request.getSession().getAttribute("CURRENT_USER");
|
||||
role.setCreater(user.getUserName());
|
||||
role.setUpdater(user.getUserName());
|
||||
role.setCreateDate(fmt.format(new Date()));
|
||||
role.setUpdateDate(fmt.format(new Date()));
|
||||
//实例化
|
||||
ImportExcelUtil.newInstance("power_RoleMapper",role, Power_Role.class);
|
||||
//导入excel的操作
|
||||
ImportExcelEntity excelEntity = ImportExcelUtil.fileImport(multipartFile,fieldNames, judgeMethods);
|
||||
CacheManager.addExcCount("noExc");
|
||||
if(excelEntity.getSuccessCount() == 0 && excelEntity.getWrongCount() == 0){
|
||||
//无数据
|
||||
return new ResponseEntity<String>("无数据!", responseHeaders, HttpStatus.OK);
|
||||
}
|
||||
if(excelEntity.getWrongCount() == 0){
|
||||
//成功
|
||||
return new ResponseEntity<String>(null, responseHeaders, HttpStatus.OK);
|
||||
}else{
|
||||
//有出错数据
|
||||
String msgStr = excelEntity.getWorkBookKey()+"@已成功导入"+excelEntity.getSuccessCount()+"条,失败"+excelEntity.getWrongCount()+"条,随后将导出错误记录!";
|
||||
return new ResponseEntity<String>(msgStr, responseHeaders, HttpStatus.OK);
|
||||
}
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
//抛异常
|
||||
return new ResponseEntity<String>(e.getMessage(), responseHeaders, HttpStatus.OK);
|
||||
}finally {
|
||||
if(os != null){
|
||||
try {
|
||||
os.close();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.manage.controller;
|
||||
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.util.Msg;
|
||||
import com.manage.entity.T_Menu;
|
||||
import com.manage.service.T_MenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* <p>Title:T_UserController </p>
|
||||
* <p>Description:处理用户请求 </p>
|
||||
* <p>Company: </p>
|
||||
* @author hu
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/menu")
|
||||
public class T_MenuController {
|
||||
|
||||
@Autowired
|
||||
T_MenuService t_menuService;
|
||||
|
||||
/**
|
||||
* 根据id获取用户信息
|
||||
*/
|
||||
@RequestMapping(value="/infoById/{id}",method=RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Msg getinfoById(@PathVariable("id")Integer id){
|
||||
try {
|
||||
T_Menu obj=new T_Menu();
|
||||
obj=t_menuService.getRole();
|
||||
CacheManager.addExcCount("noExc");
|
||||
return Msg.success().add("obj", obj);
|
||||
}catch (Exception e){
|
||||
CacheManager.addExcCount("exc");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.manage.interceptor;
|
||||
|
||||
import com.manage.encrypt.Base64;
|
||||
import com.manage.encrypt.MD5;
|
||||
import com.manage.entity.Power_User;
|
||||
import com.manage.service.cache.Cache;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.service.Power_UserService;
|
||||
import com.manage.util.Constant;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.PathMatcher;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Properties;
|
||||
|
||||
public class LoginInterceptor implements HandlerInterceptor {
|
||||
@Autowired
|
||||
Power_UserService powerUserService;
|
||||
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
|
||||
String ctx = request.getServletContext().getContextPath();
|
||||
String url = request.getRequestURI();
|
||||
if("/power/".equals(url)|| "/".equals(url)){
|
||||
request.getRequestDispatcher("/login").forward(request, response);
|
||||
}
|
||||
url = url.replace(ctx,"");
|
||||
String[] s = url.split("/");
|
||||
String parentUrl = "";
|
||||
if(!"/".equals(url)){
|
||||
parentUrl = "/"+s[1];
|
||||
}
|
||||
if(!"/getSessionRemainingTime".equals(parentUrl)){
|
||||
request.getSession().setAttribute(request.getSession().getId(),System.currentTimeMillis());
|
||||
}
|
||||
if (excludes(parentUrl, Constant.RELEASE_REQUEST,request)) {
|
||||
response.setHeader("Access-Control-Allow-Origin","*");
|
||||
return true;
|
||||
}else{
|
||||
String token = (String)request.getSession().getAttribute("token");
|
||||
if(StringUtils.isNoneBlank(token)){
|
||||
token = MD5.JM(Base64.decode(token));
|
||||
Cache cache = CacheManager.getCacheInfo(token);
|
||||
if (cache != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
request.getRequestDispatcher("/login").forward(request, response);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
private boolean excludes(String url,String key,HttpServletRequest request){
|
||||
Properties props = new Properties();
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
try {
|
||||
props.load(loader.getResourceAsStream("/config/config.properties"));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
String value = props.getProperty(key);
|
||||
if(value != null && !"/".equals(value) && value.indexOf(",") != -1){
|
||||
String[] values = value.split(",");
|
||||
PathMatcher matcher = new AntPathMatcher();
|
||||
for(String v : values){
|
||||
if(matcher.match(v,url))
|
||||
return true;
|
||||
}
|
||||
}else if(value.equals(url)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isHasAuthority(String url,Power_User power_user){
|
||||
if(!powerUserService.validUserRoleMenu(url,power_user.getUserId())){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.manage.interfaces.cache;
|
||||
|
||||
/**
|
||||
* @Description 缓存DTO
|
||||
* @Date 2019/7/2 11:41
|
||||
* @Created by ljx
|
||||
*/
|
||||
public class Cache {
|
||||
private String key;//缓存ID
|
||||
private Object value;//缓存数据
|
||||
private long timeOut;//更新时间
|
||||
private boolean expired; //是否终止
|
||||
public Cache() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Cache(String key, Object value, long timeOut, boolean expired) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
this.timeOut = timeOut;
|
||||
this.expired = expired;
|
||||
}
|
||||
|
||||
public Cache(String key, Object value, long timeOut) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
this.timeOut = timeOut;
|
||||
}
|
||||
public Cache(String key, Object value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public long getTimeOut() {
|
||||
return timeOut;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setKey(String string) {
|
||||
key = string;
|
||||
}
|
||||
|
||||
public void setTimeOut(long l) {
|
||||
timeOut = l;
|
||||
}
|
||||
|
||||
public void setValue(Object object) {
|
||||
value = object;
|
||||
}
|
||||
|
||||
public boolean isExpired() {
|
||||
return expired;
|
||||
}
|
||||
|
||||
public void setExpired(boolean b) {
|
||||
expired = b;
|
||||
}
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
package com.manage.interfaces.cache;
|
||||
|
||||
import com.manage.vo.Power_UserVo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class CacheManager {
|
||||
private static HashMap cacheMap = new HashMap();
|
||||
|
||||
private CacheManager() {
|
||||
super();
|
||||
}
|
||||
public static boolean getSimpleFlag(String key){
|
||||
try{
|
||||
return (Boolean) cacheMap.get(key);
|
||||
}catch(NullPointerException e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static long getServerStartdt(String key){
|
||||
try {
|
||||
return (Long)cacheMap.get(key);
|
||||
} catch (Exception ex) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public synchronized static boolean setSimpleFlag(String key,boolean flag){
|
||||
if (flag && getSimpleFlag(key)) {
|
||||
return false;
|
||||
}else{
|
||||
cacheMap.put(key, flag);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public synchronized static boolean setSimpleFlag(String key,long serverbegrundt){
|
||||
if (cacheMap.get(key) == null) {
|
||||
cacheMap.put(key,serverbegrundt);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private synchronized static Cache getCache(String key) {
|
||||
return (Cache) cacheMap.get(key);
|
||||
}
|
||||
|
||||
private synchronized static boolean hasCache(String key) {
|
||||
return cacheMap.containsKey(key);
|
||||
}
|
||||
|
||||
public synchronized static void clearAll() {
|
||||
cacheMap.clear();
|
||||
}
|
||||
|
||||
public synchronized static void clearAll(String type) {
|
||||
Iterator i = cacheMap.entrySet().iterator();
|
||||
String key;
|
||||
ArrayList<String> arr = new ArrayList<String>();
|
||||
try {
|
||||
while (i.hasNext()) {
|
||||
java.util.Map.Entry entry = (java.util.Map.Entry) i.next();
|
||||
key = (String) entry.getKey();
|
||||
if (key.startsWith(type)) {
|
||||
arr.add(key);
|
||||
}
|
||||
}
|
||||
for (int k = 0; k < arr.size(); k++) {
|
||||
clearOnly(arr.get(k));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized static void clearOnly(String key) {
|
||||
cacheMap.remove(key);
|
||||
}
|
||||
|
||||
public synchronized static void putCache(String key, Cache obj) {
|
||||
cacheMap.put(key, obj);
|
||||
}
|
||||
|
||||
public static Cache getCacheInfo(String key) {
|
||||
|
||||
if (hasCache(key)) {
|
||||
Cache cache = getCache(key);
|
||||
if (cacheExpired(cache)) {
|
||||
cache.setExpired(true);
|
||||
}
|
||||
return cache;
|
||||
}else
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void putCacheInfo(String key, Cache obj, long dt,boolean expired) {
|
||||
Cache cache = new Cache();
|
||||
cache.setKey(key);
|
||||
cache.setTimeOut(dt + System.currentTimeMillis());
|
||||
cache.setValue(obj);
|
||||
cache.setExpired(expired);
|
||||
cacheMap.put(key, cache);
|
||||
}
|
||||
public static void putCacheInfo(String key,Cache obj,long dt){
|
||||
Cache cache = new Cache();
|
||||
cache.setKey(key);
|
||||
cache.setTimeOut(dt+System.currentTimeMillis());
|
||||
cache.setValue(obj);
|
||||
cache.setExpired(false);
|
||||
cacheMap.put(key,cache);
|
||||
}
|
||||
|
||||
public static boolean cacheExpired(Cache cache) {
|
||||
if (null == cache) {
|
||||
return false;
|
||||
}
|
||||
long nowDt = System.currentTimeMillis();
|
||||
long cacheDt = cache.getTimeOut();
|
||||
if (cacheDt <= 0||cacheDt>nowDt) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getCacheSize() {
|
||||
return cacheMap.size();
|
||||
}
|
||||
|
||||
public static int getCacheSize(String type) {
|
||||
int k = 0;
|
||||
Iterator i = cacheMap.entrySet().iterator();
|
||||
String key;
|
||||
try {
|
||||
while (i.hasNext()) {
|
||||
java.util.Map.Entry entry = (java.util.Map.Entry) i.next();
|
||||
key = (String) entry.getKey();
|
||||
if (key.indexOf(type) != -1) {
|
||||
k++;
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
return k;
|
||||
}
|
||||
|
||||
public static ArrayList<String> getCacheAllkey() {
|
||||
ArrayList a = new ArrayList();
|
||||
try {
|
||||
Iterator i = cacheMap.entrySet().iterator();
|
||||
while (i.hasNext()) {
|
||||
java.util.Map.Entry entry = (java.util.Map.Entry) i.next();
|
||||
a.add((String) entry.getKey());
|
||||
}
|
||||
} catch (Exception ex) {} finally {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<String> getCacheListkey(String type) {
|
||||
ArrayList a = new ArrayList();
|
||||
String key;
|
||||
try {
|
||||
Iterator i = cacheMap.entrySet().iterator();
|
||||
while (i.hasNext()) {
|
||||
java.util.Map.Entry entry = (java.util.Map.Entry) i.next();
|
||||
key = (String) entry.getKey();
|
||||
if (key.indexOf(type) != -1) {
|
||||
a.add(key);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {} finally {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized static void removeCacheByObject(Power_UserVo obj) {
|
||||
ArrayList a = new ArrayList();
|
||||
Object key;
|
||||
ArrayList<String> arr = new ArrayList<String>();
|
||||
try {
|
||||
Iterator i = cacheMap.entrySet().iterator();
|
||||
while (i.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry) i.next();
|
||||
Cache cache = CacheManager.getCacheInfo((String)entry.getKey());
|
||||
Power_UserVo o = (Power_UserVo)cache.getValue();
|
||||
if (obj.getUserName().equals(o.getUserName())) {
|
||||
arr.add((String)entry.getKey());
|
||||
}
|
||||
}
|
||||
if(null != arr && !arr.isEmpty()){
|
||||
for (int k = 0; k < arr.size(); k++) {
|
||||
clearOnly(arr.get(k));
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.manage.interfaces.webservice;
|
||||
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebParam;
|
||||
import javax.jws.WebService;
|
||||
|
||||
@WebService
|
||||
public interface PowerWebService {
|
||||
|
||||
@WebMethod()
|
||||
String getInfosByUserId(@WebParam(name = "token") String token,String sysId);
|
||||
|
||||
@WebMethod
|
||||
String tempTest();
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.manage.interfaces.webservice;
|
||||
|
||||
|
||||
import com.manage.vo.PowerTree;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
import java.util.List;
|
||||
|
||||
@WebService
|
||||
public interface RoleAndUserTreeWebService {
|
||||
@WebMethod()
|
||||
List<PowerTree> getRolePowerTree();
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.manage.interfaces.webservice.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.manage.dao.Power_MenuMapper;
|
||||
import com.manage.encrypt.Base64;
|
||||
import com.manage.encrypt.MD5;
|
||||
import com.manage.entity.Power_Menu;
|
||||
import com.manage.entity.Power_User;
|
||||
import com.manage.service.cache.Cache;
|
||||
import com.manage.service.cache.CacheManager;
|
||||
import com.manage.interfaces.webservice.PowerWebService;
|
||||
import com.manage.service.User_Dept_MenuService;
|
||||
import com.manage.util.Constant;
|
||||
import com.manage.vo.Power_UserVo;
|
||||
import com.manage.vo.Power_UserWebServiceVo;
|
||||
import com.manage.vo.User_Dept_Menu;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.jws.WebService;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@WebService(serviceName = "PowerWebService",
|
||||
targetNamespace = "http://webservice.interfaces.manage.com/",
|
||||
endpointInterface = "com.manage.interfaces.webservice.PowerWebService"
|
||||
)
|
||||
public class PowerWebServiceImpl implements PowerWebService {
|
||||
@Autowired
|
||||
Power_MenuMapper powerMenuMapper;
|
||||
@Autowired
|
||||
User_Dept_MenuService userDeptMenuService;
|
||||
|
||||
@Override
|
||||
public String getInfosByUserId(String token,String sysFlag) {
|
||||
Power_UserWebServiceVo userWebServiceVo = new Power_UserWebServiceVo();
|
||||
if(StringUtils.isNotBlank(token) && StringUtils.isNotBlank(token) ){
|
||||
token = MD5.JM(Base64.decode(token));
|
||||
Cache cache = CacheManager.getCacheInfo(token);
|
||||
if(cache != null){
|
||||
Power_UserVo user = (Power_UserVo) cache.getValue();
|
||||
//设置名字
|
||||
user.setUserPosition(user.getName());
|
||||
List<User_Dept_Menu> menuList = user.getMenuList();
|
||||
Set<String> menus = new TreeSet();
|
||||
try {
|
||||
for(User_Dept_Menu menu : menuList){
|
||||
if(StringUtils.isNotBlank(menu.getMenuUrl()) && StringUtils.isNotBlank(menu.getSysFlag()) && sysFlag.equals(menu.getSysFlag()) && StringUtils.isNotBlank(menu.getMethod())){
|
||||
menus.add(menu.getMenuUrl());
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
BeanUtils.copyProperties(user,userWebServiceVo);
|
||||
//可预览信息设置在手机号字段
|
||||
userWebServiceVo.setUserTel(user.getShowRecord()+"");
|
||||
//可下载信息设置在邮箱字段
|
||||
userWebServiceVo.setUserEmail(user.getDownloadRecord()+"");
|
||||
//查看打印简要设置在职位字段
|
||||
userWebServiceVo.setUserAge(user.getShowPrint());
|
||||
userWebServiceVo.setMenus(menus);
|
||||
}
|
||||
}
|
||||
return JSON.toJSONString(userWebServiceVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tempTest() {
|
||||
return "aaaa~~~~~~~~~~~~~~~~~~~~~~~";
|
||||
}
|
||||
|
||||
private List<Power_Menu> getPowerMenuMethods(Power_User powerUser, String sysId){
|
||||
// 根据用户ID以及系统Id查出所有的用户菜单
|
||||
List<Power_Menu> powerUserMenus = powerMenuMapper.selectUserMenuByUserIdAndDictId(powerUser.getUserId(), Integer.parseInt(sysId));
|
||||
// 根据用户ID以及系统Id查出所有的角色菜单
|
||||
List<Power_Menu> powerRoleMenus = powerMenuMapper.selectRoleMenuByUserIdAndDictId(powerUser.getUserId(), Integer.parseInt(sysId));
|
||||
// 当前用户的所有菜单集合
|
||||
List<Power_Menu> tempPowerMenus = new ArrayList<>(powerRoleMenus);
|
||||
for (Power_Menu powerMenu:powerUserMenus) {
|
||||
if(powerMenu.getFlag() == Constant.EFFECTIVE_YES){
|
||||
tempPowerMenus.add(powerMenu);
|
||||
}else if(powerMenu.getFlag() == Constant.EFFECTIVE_NO){
|
||||
tempPowerMenus.remove(powerMenu);
|
||||
}
|
||||
}
|
||||
|
||||
List<Power_Menu> powerMenus = new ArrayList<>(tempPowerMenus);
|
||||
for (Power_Menu powerMenu:tempPowerMenus) {
|
||||
for (int i = 0;i<tempPowerMenus.size();i++) {
|
||||
if(powerMenu.getParentId().equals(tempPowerMenus.get(i).getMenuId()) && powerMenu.getMethod() != null){
|
||||
powerMenus.get(i).getMethods().add(powerMenu);
|
||||
powerMenus.remove(powerMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
return powerMenus;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.manage;
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/11/28 11:42
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/11/28 11:42
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class test {
|
||||
public static void main(String[] args) throws Exception{
|
||||
String str = "temperature_stat.htm";
|
||||
readfile(str);
|
||||
}
|
||||
public static String readfile(String filePath){
|
||||
File file = new File(filePath);
|
||||
InputStream input = null;
|
||||
try {
|
||||
input = new FileInputStream(file);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
byte[] bytes = new byte[1024];
|
||||
try {
|
||||
for(int n ; (n = input.read(bytes))!=-1 ; ){
|
||||
buffer.append(new String(bytes,0,n,"GBK"));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
int i = buffer.toString().lastIndexOf("</TD>");
|
||||
String substring = buffer.substring(0, i);
|
||||
String substring1 = substring.substring(substring.length() - 4, substring.length());
|
||||
Float f = Float.valueOf(substring1);
|
||||
Math.round(f);
|
||||
System.out.println(substring1);
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
public String getBody(String val) {
|
||||
String start = "<body>";
|
||||
String end = "</body>";
|
||||
int s = val.indexOf(start) + start.length();
|
||||
int e = val.indexOf(end);
|
||||
return val.substring(s, e);
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
import com.veraxsystems.vxipmi.api.async.ConnectionHandle;
|
||||
import com.veraxsystems.vxipmi.api.sync.IpmiConnector;
|
||||
import com.veraxsystems.vxipmi.coding.commands.IpmiVersion;
|
||||
import com.veraxsystems.vxipmi.coding.commands.PrivilegeLevel;
|
||||
import com.veraxsystems.vxipmi.coding.commands.chassis.GetChassisStatus;
|
||||
import com.veraxsystems.vxipmi.coding.commands.chassis.GetChassisStatusResponseData;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.GetSdr;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.GetSdrResponseData;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.GetSensorReading;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.GetSensorReadingResponseData;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.ReserveSdrRepository;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.ReserveSdrRepositoryResponseData;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.record.CompactSensorRecord;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.record.FullSensorRecord;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.record.RateUnit;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.record.ReadingType;
|
||||
import com.veraxsystems.vxipmi.coding.commands.sdr.record.SensorRecord;
|
||||
import com.veraxsystems.vxipmi.coding.payload.CompletionCode;
|
||||
import com.veraxsystems.vxipmi.coding.payload.lan.IPMIException;
|
||||
import com.veraxsystems.vxipmi.coding.protocol.AuthenticationType;
|
||||
import com.veraxsystems.vxipmi.coding.security.CipherSuite;
|
||||
import com.veraxsystems.vxipmi.common.TypeConverter;
|
||||
import com.veraxsystems.vxipmi.connection.Connection;
|
||||
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName:
|
||||
* @Description:
|
||||
* @Param 传输参数
|
||||
* @Return
|
||||
* @Author: 曾文和
|
||||
* @CreateDate: 2019/11/29 15:31
|
||||
* @UpdateUser: 曾文和
|
||||
* @UpdateDate: 2019/11/29 15:31
|
||||
* @UpdateRemark: 更新说明
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class test {
|
||||
private static final int MAX_REPO_RECORD_ID = 65535;
|
||||
|
||||
private static final String hostname = "127.0.0.1";
|
||||
|
||||
private static final String username = "Administrator";
|
||||
|
||||
private static final String password = "zwh05966788561";
|
||||
|
||||
/**
|
||||
* Size of the initial GetSdr message to get record header and size
|
||||
*/
|
||||
private static final int INITIAL_CHUNK_SIZE = 8;
|
||||
|
||||
/**
|
||||
* Chunk size depending on buffer size of the IPMI server. Bigger values will improve performance. If server is
|
||||
* returning "Cannot return number of requested data bytes." error during GetSdr command, CHUNK_SIZE should be
|
||||
* decreased.
|
||||
*/
|
||||
private static final int CHUNK_SIZE = 16;
|
||||
|
||||
/**
|
||||
* Size of SDR record header
|
||||
*/
|
||||
private static final int HEADER_SIZE = 5;
|
||||
|
||||
private int nextRecId;
|
||||
|
||||
public static void main(String[] args) {
|
||||
IpmiConnector connector = null;
|
||||
ConnectionHandle handle = null;
|
||||
try {
|
||||
connector = new IpmiConnector(8081);
|
||||
System.out.println("Connector created");
|
||||
|
||||
// Create the connection and get the handle, specifiy IP address of the
|
||||
// remote host. The connection is being registered in ConnectionManager,
|
||||
// the handle will be needed to identify it among other connections
|
||||
// (target IP address isn't enough, since we can handle multiple
|
||||
// connections to the same host)
|
||||
handle = connector.createConnection(InetAddress
|
||||
.getByName("127.0.0.1"));
|
||||
System.out.println("Connection created");
|
||||
|
||||
// Get available cipher suites list via getAvailableCipherSuites and
|
||||
// pick one of them that will be used further in the session.
|
||||
CipherSuite cs = connector.getAvailableCipherSuites(handle).get(3);
|
||||
System.out.println("Cipher suite picked");
|
||||
|
||||
// Provide chosen cipher suite and privilege level to the remote host.
|
||||
// From now on, your connection handle will contain these information.
|
||||
connector.getChannelAuthenticationCapabilities(handle, cs,
|
||||
PrivilegeLevel.User);
|
||||
System.out.println("Channel authentication capabilities receivied");
|
||||
|
||||
// Start the session, provide username and password, and optionally the
|
||||
// BMC key (only if the remote host has two-key authentication enabled,
|
||||
// otherwise this parameter should be null)
|
||||
connector.openSession(handle, "admin", "password", null);
|
||||
System.out.println("Session open");
|
||||
|
||||
// Send some message and read the response
|
||||
GetChassisStatusResponseData response = (GetChassisStatusResponseData) connector
|
||||
.sendMessage(handle, new GetChassisStatus(IpmiVersion.V20, cs, AuthenticationType.RMCPPlus));
|
||||
|
||||
System.out.println("Received answer");
|
||||
System.out.println("System power state is "
|
||||
+ (response.isPowerOn() ? "up" : "down"));
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
// Close the session
|
||||
connector.closeSession(handle);
|
||||
System.out.println("Session closed");
|
||||
|
||||
// Close connection manager and release the listener port.
|
||||
connector.tearDown();
|
||||
System.out.println("Connection manager closed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
jdbc.driver=com.mysql.jdbc.Driver
|
||||
jdbc.url=jdbc\:mysql\://localhost\:3306/power?useUnicode\=true&characterEncoding\=utf-8
|
||||
jdbc.username=root
|
||||
jdbc.password=docus702
|
||||
|
||||
#hibernate config
|
||||
hibernate.dialect = org.hibernate.dialect.MySQLDialect
|
||||
hibernate.show_sql = true
|
||||
hibernate.format_sql = true
|
||||
hibernate.hbm2ddl.auto =update
|
||||
#hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
|
||||
hibernate.current_session_context_class=thread
|
||||
|
||||
hibernate.jdbc.batch_size=50
|
||||
hibernate.enable_lazy_load_no_trans=true
|
||||
|
||||
#执行:右键 Run As ---->Maven build ---->Goals:mybatis-generator:generate
|
||||
#输出目录
|
||||
targetProject=src/main/java
|
||||
#modelPackage,sqlMapperPackage,daoMapperPackage 通常一致??
|
||||
modelPackage=com.manage.entity
|
||||
daoMapperPackage=com.manage.dao
|
||||
#输出目录
|
||||
targetProject2=src/main/resources
|
||||
sqlMapperPackage=mapper
|
||||
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE configuration
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<settings>
|
||||
<!-- 列自动映射 -->
|
||||
<setting name="mapUnderscoreToCamelCase" value="true"/>
|
||||
<!--<setting name="logImpl" value="STDOUT_LOGGING"/>-->
|
||||
</settings>
|
||||
|
||||
<typeAliases>
|
||||
<package name="com.manage.entity"/>
|
||||
</typeAliases>
|
||||
|
||||
<plugins>
|
||||
<!-- com.github.pagehelper为PageHelper类所在包名 -->
|
||||
<plugin interceptor="com.github.pagehelper.PageInterceptor">
|
||||
<!--分页参数合理化-->
|
||||
<property name="reasonable" value="true"/>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</configuration>
|
@ -0,0 +1,4 @@
|
||||
##获取cpu温度cvs文件路径
|
||||
TEMPERATURECVSFILEDIR = D:\\tools\\temperature_stat.htm
|
||||
##cpu温度cvs文件显示温度数据的行数
|
||||
TEMPERATUREROWNUM = 9
|
@ -0,0 +1,48 @@
|
||||
package com.manage;
|
||||
|
||||
import com.manage.dao.Power_MenuMapper;
|
||||
import com.manage.dao.T_MenuMapper;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.FileSystemXmlApplicationContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
|
||||
public class MapperTest {
|
||||
/**
|
||||
* 测试角色mapper
|
||||
*/
|
||||
public static void main(String[] arg){
|
||||
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
|
||||
Client client = dcf.createClient("http://192.168.1.3:8081/WebService/PowerWebService?wsdl");
|
||||
Object[] objects = new Object[0];
|
||||
String error = null;
|
||||
try {
|
||||
// invoke("方法名",参数1,参数2,参数3....);
|
||||
objects = client.invoke("getInfosByUserId",token,"0");
|
||||
Result result = JSON.parseObject(objects[0].toString()
|
||||
, new TypeReference<Result>() {});
|
||||
String permStrs = "";
|
||||
if(null != result.getPowerMenuList() && !result.getPowerMenuList().isEmpty()){
|
||||
for (Power_Menu p: result.getPowerMenuList()) {
|
||||
if(StringUtils.isNoneBlank(p.getMenuName())){
|
||||
permStrs+=p.getMenuName() + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
Power_User powerUser = result.getPowerUser();
|
||||
if(powerUser != null){
|
||||
Power_User admin = (Power_User)SecurityUtils.getSubject().getPrincipal();
|
||||
UserToken userToken = new UserToken(powerUser.getUserName(),powerUser.getUserPwd(),true,powerUser.getRoleId(),permStrs);
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
subject.login(userToken);
|
||||
}
|
||||
String msg = "";
|
||||
if (error != null) {//出错了,返回登录页面
|
||||
return "redirect://http:192.168.1.3:8080/login";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<c:set var="path" value="${pageContext.request.contextPath}"/>
|
||||
<%@taglib prefix="pm" uri="/WEB-INF/taglib/guardtag.tld"%>
|
||||
|
||||
<!-- 引入Jquery -->
|
||||
<%--<script type="text/javascript" src="${path}/static/js/jquery-1.12.4.min.js"></script>--%>
|
||||
<script type="text/javascript" src="${path}/static/js/jquery-3.3.1.js"></script>
|
||||
<%--<script type="text/javascript" src="${ctx}/static/js/page.js"></script>--%>
|
||||
<!-- 引入样式 -->
|
||||
<%--<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7-dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7-dist/css/bootstrap-theme.css">
|
||||
<script type="text/javascript" src="${path}/static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>--%>
|
||||
<%--<link rel="stylesheet" href="${path}/static/css/comm.css">--%>
|
||||
<link rel="stylesheet" href="${path}/static/css/comm.css"/>
|
||||
|
||||
|
||||
<%--
|
||||
<link rel="stylesheet" href="${path}/static/css/jquery-ui-themes.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/css/axure_rp_page.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/css/styles.css"/>--%>
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/bootstrap/dist/css/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/font-awesome/css/font-awesome.min.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/Ionicons/css/ionicons.min.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/dist/css/AdminLTE.min.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/dist/css/skins/_all-skins.min.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/morris.js/morris.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/jvectormap/jquery-jvectormap.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css"/>
|
||||
<link rel="stylesheet" href="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-table/bootstrap-table.min.css">
|
||||
<link rel="stylesheet" href="${path}/static/css/bootstrap-select.min.css">
|
||||
<link rel="stylesheet" href="${path}/static/js/toastr.min.css" type="text/css">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
|
||||
|
||||
<!-- jQuery 3 -->
|
||||
<%--<script src="${path}/static/bootstrap-3.3.7/bower_components/jquery/dist/jquery.min.js"></script>--%>
|
||||
<!-- jQuery UI 1.11.4 -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/jquery-ui/jquery-ui.min.js"></script>
|
||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
||||
<script>
|
||||
$.widget.bridge('uibutton', $.ui.button);
|
||||
</script>
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<!-- Morris.js charts -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/raphael/raphael.min.js"></script>
|
||||
<%--<script src="${path}/static/bootstrap-3.3.7/bower_components/morris.js/morris.min.js"></script>--%>
|
||||
<!-- Sparkline -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
|
||||
<!-- jvectormap -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
|
||||
<script src="${path}/static/bootstrap-3.3.7/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
|
||||
<!-- jQuery Knob Chart -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
|
||||
<!-- daterangepicker -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/moment/min/moment.min.js"></script>
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
<!-- datepicker -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
|
||||
<!-- Bootstrap WYSIHTML5 -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
|
||||
<!-- Slimscroll -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
|
||||
<!-- FastClick -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/fastclick/lib/fastclick.js"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="${path}/static/bootstrap-3.3.7/dist/js/adminlte.min.js"></script>
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-table/bootstrap-table.js"></script>
|
||||
<script src="${path}/static/bootstrap-3.3.7/bower_components/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
|
||||
<script src="${path}/static/js/bootstrap-select.min.js"></script>
|
||||
<script src="${path}/static/js/toastr.min.js"></script>
|
||||
<script src="${path}/static/js/jquery.form.js"></script>
|
||||
<script>
|
||||
toastr.options.positionClass = 'toast-top-right';
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
var path = "${path}";
|
||||
//回跳表格页码
|
||||
function backToPage(){
|
||||
refresh();
|
||||
setTimeout(function(){
|
||||
var pageSize=$('#bootstrapTable').bootstrapTable('getOptions').pageSize;
|
||||
var rows=$('#bootstrapTable').bootstrapTable("getOptions").totalRows;
|
||||
if((pageSize*(pageNumber-1)) == rows && pageNumber != 1){
|
||||
pageNumber -= 1;
|
||||
}
|
||||
$('#bootstrapTable').bootstrapTable('selectPage', pageNumber);
|
||||
},100)
|
||||
}
|
||||
function toPage() {
|
||||
var pageNum = $("#pageNum").val();
|
||||
if (pageNum) {
|
||||
$('#bootstrapTable').bootstrapTable('selectPage', parseInt(pageNum));
|
||||
}
|
||||
setTimeout(function(){
|
||||
$("#pageNum").val(pageNum)
|
||||
},500)
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/WEB-INF/jspf/confirmJsp.jspf"%>
|
@ -0,0 +1,45 @@
|
||||
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<c:set var="path" value="${pageContext.request.contextPath}"/>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<link rel="stylesheet" href="${path}/static/js/jquery-confirm.min.css">
|
||||
<script src="${path}/static/js/jquery-confirm.min.js"></script>
|
||||
<input type="hidden" id="common_confirm_btn" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#common_confirm_model">
|
||||
<div id="common_confirm_model" class="modal" style="z-index: 99999">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
<h5 class="modal-title"><i class="fa fa-exclamation-circle"></i> <span class="title"></span></h5>
|
||||
</div>
|
||||
<div class="modal-body small">
|
||||
<p ><span class="message"></span></p>
|
||||
</div>
|
||||
<div class="modal-footer" >
|
||||
<button type="button" class="btn btn-primary ok" data-dismiss="modal">确认</button>
|
||||
<button type="button" class="btn btn-default cancel" data-dismiss="modal">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var Common = {
|
||||
confirm:function(params){
|
||||
var model = $("#common_confirm_model");
|
||||
model.find(".title").html(params.title)
|
||||
model.find(".message").html(params.message)
|
||||
|
||||
$("#common_confirm_btn").click()
|
||||
//每次都将监听先关闭,防止多次监听发生,确保只有一次监听
|
||||
model.find(".cancel").off("click")
|
||||
model.find(".ok").off("click")
|
||||
|
||||
model.find(".ok").on("click",function(){
|
||||
params.operate(true)
|
||||
})
|
||||
|
||||
model.find(".cancel").on("click",function(){
|
||||
params.operate(false)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,33 @@
|
||||
<c:set var="path" value="${pageContext.request.contextPath}"/>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<style>
|
||||
.loading {
|
||||
width: 160px;
|
||||
height: 56px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
line-height: 56px;
|
||||
color: #fff;
|
||||
padding-left: 60px;
|
||||
font-size: 15px;
|
||||
background: #000;
|
||||
opacity: 0.7;
|
||||
z-index: 9999;
|
||||
-moz-border-radius: 20px;
|
||||
-webkit-border-radius: 20px;
|
||||
border-radius: 20px;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
|
||||
}
|
||||
</style>
|
||||
<div id="loadingModal" class="modal fade" data-keyboard="false"
|
||||
data-backdrop="static" data-role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div id="loading" class="loading">加载中。。。</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$("#loading").css("background","url("+path+"/static/img/load.gif) no-repeat 10px 50%");
|
||||
$('#loadingModal').modal('show');
|
||||
})
|
||||
</script>
|
@ -0,0 +1,86 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<link rel="stylesheet" href="${path}/static/naranja/css/naranja.min.css"/>
|
||||
<script type="text/javascript" src="${path}/static/naranja/js/naranja.js"></script>
|
||||
<script type="text/javascript" src="${path}/static/naranja/sockjs.js"></script>
|
||||
<script>
|
||||
var powerUrlHead = path;
|
||||
/*********通知操作**********************************************/
|
||||
$(function(){
|
||||
getNoticeCount();
|
||||
})
|
||||
//赋值未通知数量
|
||||
function getNoticeCount(){
|
||||
//赋值未通知数量
|
||||
$.ajax({
|
||||
type:'get',
|
||||
url:powerUrlHead+'/notice/getUnReadCount',
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 100){
|
||||
$("#noticeCount").text(data.extend.unReadCount);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//每隔1分钟轮询一次未通知数量
|
||||
setInterval(function () {
|
||||
getNoticeCount();
|
||||
}, 60*1000);
|
||||
//每隔1秒钟轮询一次session所剩时间
|
||||
var r = setInterval(function () {
|
||||
$.get(path+'/getSessionRemainingTime',function(data){
|
||||
if(data != null){
|
||||
data /= 1000
|
||||
if(data < 11 && data > 10){
|
||||
toastr.warning("还有10秒将登录超时,将退出登录!")
|
||||
}else if(data < 6 && data > 5){
|
||||
toastr.warning("还有5秒将登录超时,将退出登录!")
|
||||
}else if(data < 0){
|
||||
window.location.href = path + '/login'
|
||||
}
|
||||
}
|
||||
},'json');
|
||||
}, 1000);
|
||||
//跳转到通知
|
||||
function noticeManage1(noticeId){
|
||||
var url = powerUrlHead+"/gatewayPage?noticeId="+noticeId;
|
||||
window.location.href = url;
|
||||
}
|
||||
/*********webSocket**********************************************/
|
||||
var userId = $("#userId").val();
|
||||
var strSplit = $("#strSplit").val();
|
||||
var webSocketUrl = $("#webSocketUrl").val();
|
||||
var ws = new WebSocket("ws://"+webSocketUrl);
|
||||
ws.onopen = function(){
|
||||
ws.send(userId);
|
||||
console.log("连接...")
|
||||
}
|
||||
|
||||
//处理服务器发送来的数据
|
||||
ws.onmessage = function(e){
|
||||
var msg = e.data.split(strSplit);
|
||||
narn('warn',msg[0],msg[1],msg[2]);
|
||||
}
|
||||
|
||||
ws.onclose = function(){
|
||||
console.log("连接关闭");
|
||||
}
|
||||
|
||||
ws.onerror = function(){
|
||||
console.log('连接失败');
|
||||
}
|
||||
|
||||
function narn (type,title,text,noticeId) {
|
||||
naranja()[type]({
|
||||
title: title,
|
||||
text: text,
|
||||
timeout: 1000*60,
|
||||
buttons: [{
|
||||
text: '查看详情',
|
||||
click: function (e) {
|
||||
noticeManage1(noticeId);
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
</script>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,155 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<%@ include file="/WEB-INF/jspf/confirmJsp.jspf" %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>归属管理</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<link rel="stylesheet" href="${path}/static/css/comm.css">
|
||||
<link rel="stylesheet" href="${path}/static/zTree_v3-master/css/zTreeStyle/zTreeStyle.css" type="text/css">
|
||||
<script src="${path}/static/zTree_v3-master/js/jquery.ztree.all.js"></script>
|
||||
<script src="${path}/static/zTree_v3-master/js/jquery.ztree.exhide.js"></script>
|
||||
<script>
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.widget-header{
|
||||
height:26px;
|
||||
background-color: #1D9ED7;
|
||||
font-size: 16px!important;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
/*页头*/
|
||||
.panel-heading{
|
||||
padding: 0 16px;
|
||||
|
||||
}
|
||||
hr{
|
||||
margin:0;
|
||||
}
|
||||
/*左边树div*/
|
||||
.treeDiv{
|
||||
float:left;
|
||||
width:30%;
|
||||
height:100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.searcDiv{
|
||||
padding-left: 60px;
|
||||
padding-right: 60px;
|
||||
padding-top: 2%;
|
||||
}
|
||||
.ztree{
|
||||
border: 0px!important;
|
||||
background-color: #fff!important;
|
||||
overflow: auto!important;
|
||||
font-size: 14rem!important;
|
||||
height: 600px!important;
|
||||
width: 300px!important;
|
||||
}
|
||||
.treeBtn{
|
||||
margin-top:-3%;
|
||||
padding-left:19%;
|
||||
}
|
||||
.treeOperBtn{
|
||||
margin-left:20px;
|
||||
}
|
||||
div#rMenu {
|
||||
width: 60px;
|
||||
height:67px;
|
||||
position:absolute;
|
||||
visibility:hidden; top:0;
|
||||
background-color: #555;
|
||||
text-align:left;
|
||||
padding: 2px;
|
||||
}
|
||||
div#rMenu ul{
|
||||
margin-left: -40px;
|
||||
}
|
||||
div#rMenu ul li{
|
||||
margin: 1px 0;
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
background-color: #fff;
|
||||
list-style: none outside none;
|
||||
text-align: center;
|
||||
}
|
||||
/*右边内容div*/
|
||||
.contentDiv{
|
||||
float:left;
|
||||
width:69%;
|
||||
height:100%;
|
||||
margin-left: 1%;
|
||||
background-color: #fff;
|
||||
overflow: auto;
|
||||
}
|
||||
.content_wrap{
|
||||
width: 320px;
|
||||
height: 380px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="background-color: #ECF0F5">
|
||||
<div style="width:100%;">
|
||||
<div class="treeDiv">
|
||||
<div class="widget-header">
|
||||
<%--<h2> </h2>--%>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="searcDiv">
|
||||
<input type="text" id="key" value="" class="form-control input-sm"
|
||||
placeholder="医院名/部门名/系统名" maxlength="15"/><br/>
|
||||
</div>
|
||||
<div class="treeBtn">
|
||||
<button type="button" class="btn btn-primary btn-sm treeOperBtn" onclick="expandAll();">全部展开</button>
|
||||
<button type="button" class="btn btn-primary btn-sm treeOperBtn" onclick="collapseAll();">全部折叠</button>
|
||||
</div>
|
||||
<div class="content_wrap">
|
||||
<div class="" style="margin-left:60px">
|
||||
<ul id="treeDemo" class="ztree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rMenu">
|
||||
<ul>
|
||||
<pm:myPermissions permissions="/dict/add">
|
||||
<li id="m_add" onclick="addTreeNode();">增加</li>
|
||||
</pm:myPermissions>
|
||||
<pm:myPermissions permissions="/dict/delete">
|
||||
<li id="m_del" onclick="removeTreeNode();">删除</li>
|
||||
</pm:myPermissions>
|
||||
<pm:myPermissions permissions="/dict/update">
|
||||
<li id="m_reset" onclick="updateTree();">修改</li>
|
||||
</pm:myPermissions>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /span -->
|
||||
<!--子节点的名称-->
|
||||
<input type="hidden" id="childrenNodeNames">
|
||||
<!--相邻节点的名称-->
|
||||
<input type="hidden" id="nearNodeNames">
|
||||
<!--子节点的功能方法-->
|
||||
<input type="hidden" id="childrenNodeMethods">
|
||||
<!--相邻节点的功能方法-->
|
||||
<input type="hidden" id="nearNodeMethods">
|
||||
<div class="contentDiv">
|
||||
<div class="widget-header">
|
||||
<%--<h2> </h2>--%>
|
||||
</div>
|
||||
<div class="contentHead">
|
||||
<div class="panel-heading"><h4>归属信息</h4></div>
|
||||
<hr>
|
||||
</div>
|
||||
<!--存储当前树节点-->
|
||||
<input type="hidden" id="currentTreeId">
|
||||
<iframe src="${path}/dict/dictManagePage" id="iframe" name="iframe" style="width:100%;height:100%;" frameborder="0" scrolling="no"></iframe>
|
||||
</div>
|
||||
</div><!-- /span -->
|
||||
<script src="${path}/static/js/dict.js"></script>
|
||||
<script src="${path}/static/js/menu/fuzzysearch.js"></script>
|
||||
<%@ include file="/WEB-INF/jspf/loading.jspf" %>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,242 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>归属管理</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
|
||||
<link href="${path}/static/css/bootstrap-select.min.css" rel="stylesheet" />
|
||||
<script src="${path}/static/js/bootstrap-select.min.js" ></script>
|
||||
<script>
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
hr{
|
||||
margin:0;
|
||||
}
|
||||
/*右边内容div*/
|
||||
.formDiv{
|
||||
width:80%;
|
||||
height:100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.btns{
|
||||
text-align: center;
|
||||
}
|
||||
.btn{
|
||||
margin-left:23px;
|
||||
}
|
||||
/*多选下拉框*/
|
||||
.dropdown{
|
||||
margin-left: -23px!important;
|
||||
}
|
||||
.dropdown-menu {
|
||||
position: absolute;
|
||||
top: 103%;
|
||||
left: 0;
|
||||
z-index: 10000;
|
||||
display: none;
|
||||
float: left;
|
||||
list-style: none;
|
||||
text-shadow: none;
|
||||
/*max-height: 400px;*/
|
||||
margin: 0px;
|
||||
-webkit-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
|
||||
-moz-box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 1px 8px rgba(120, 234, 61, 0.55);
|
||||
font-size: 14px;
|
||||
font-family: "Segoe UI", Helvetica, Arial, sans-serif;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.dropdown-menu{
|
||||
margin-left: 23px!important;
|
||||
}
|
||||
/*短input*/
|
||||
.shortInput{
|
||||
width:100px;
|
||||
}
|
||||
.form-group{
|
||||
margin-bottom: 10px!important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="container">
|
||||
<div class="formDiv">
|
||||
<c:if test="${level == 0}">
|
||||
<!--医院信息-->
|
||||
<div id="hospitalDiv">
|
||||
<div class=""><h4>医院信息</h4></div>
|
||||
<hr>
|
||||
<div>
|
||||
<div class="box-body">
|
||||
<form class="form-horizontal" name="form1" id="form1">
|
||||
<input type="hidden" name="parentId" value="0">
|
||||
<input type="hidden" name="dictId" id="hospitalId" value="${hospital.dictId}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">医院名称:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" id="hospitalName" name="hospitalName" value="${hospital.hospitalName}" maxlength="16">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">医院地区:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" id="dictArea" name="dictArea" value="${hospital.dictArea}" maxlength="25">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">医院电话:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" id="hospitalTel" name="hospitalTel" value="${hospital.hospitalTel}" maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="btns">
|
||||
<pm:myPermissions permissions="/dict/update">
|
||||
<button type="button" class="btn btn-primary input-sm" onclick="addHospital()">保存</button>
|
||||
</pm:myPermissions>
|
||||
<button type="button" class="btn btn-default input-sm" onclick="clearForm('form1')">清空</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${level > 0}">
|
||||
<!--系统信息-->
|
||||
<div id="systemDiv">
|
||||
<!--系统医院信息-->
|
||||
<div class=""><h4>医院信息</h4></div>
|
||||
<hr>
|
||||
<div>
|
||||
<form class="form-horizontal">
|
||||
<div class="box-body">
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-2 control-label left">医院名称:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" readonly id="hospitalName1" value="${hospital.hospitalName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">医院地区:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" readonly id="dictArea1" value="${hospital.dictArea}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">医院电话:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" readonly id="hospitalTel1" value="${hospital.hospitalTel}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class=""><h4>系统信息</h4></div>
|
||||
<hr>
|
||||
<div>
|
||||
<form class="form-horizontal" id="form2" name="form2">
|
||||
<div class="box-body">
|
||||
<input type="hidden" name="dictId" id="dictId" value="${dict.dictId}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">系统标识:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" name="sysFlag" id="sysFlag" value="${dict.sysFlag}" maxlength="26">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">系统名称:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="text" class="form-control input-sm" name="sysName" id="sysName" value="${dict.sysName}" maxlength="16">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">系统分类:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<select class="form-control input-sm " id="sysType" name="sysType">
|
||||
<c:forEach items="${sysTypes}" var="types">
|
||||
<option value="${types}" <c:if test="${types == dict.sysType}">selected</c:if>>${types}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">所属医院:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<select class="form-control input-sm" id="parentId" name="parentId">
|
||||
<c:forEach items="${hospitals}" var="h">
|
||||
<option value="${h.dictId}" <c:if test="${h.dictId == hospital.hospitalId}">selected</c:if>>${h.hospitalName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="deptDiv" <c:if test="${sysTypes[0]== '权限系统'}">style="display:none"</c:if>>
|
||||
<label class="col-sm-2 control-label left">所属部门:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<c:if test="${operFlag != '' && operFlag == 'add'}">
|
||||
<select class="selectpicker" multiple id="deptId" name="deptIds" style="max-height:400px!important;overflow:scroll;" data-live-search="true" data-actions-box="true">
|
||||
<c:forEach items="${depts}" var="dept">
|
||||
<option value="${dept.deptId}" <c:if test="${deptId == dept.deptId}">selected</c:if>>${dept.deptName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</c:if>
|
||||
<c:if test="${operFlag != '' && operFlag == 'edit'}">
|
||||
<select class="form-control input-sm" id="deptId" name="deptId">
|
||||
<c:forEach items="${depts}" var="dept">
|
||||
<option value="${dept.deptId}" <c:if test="${dict.deptId == dept.deptId}">selected</c:if>>${dept.deptName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<%--<select class="selectpicker" multiple id="deptId" name="deptIds" style="max-height:400px!important;overflow:scroll;" data-live-search="true" data-actions-box="true">
|
||||
<c:forEach items="${depts}" var="dept">
|
||||
<option value="${dept.deptId}" <c:if test="${dept.checks != '' && dept.checks != null}">selected</c:if>>${dept.deptName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input type="hidden" name="deptId" value="${dict.deptId}">--%>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left"> 排序:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<input type="number" class="form-control input-sm shortInput" id="sort" name="sort" value="${dict.sort}" oninput="if(value.length>9)value=value.slice(0,9)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left"> 状态:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<select class="form-control input-sm shortInput" name="dictStatus">
|
||||
<option value="1" <c:if test="${dict.dictStatus == 1}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${dict.dictStatus == 0}">selected</c:if>>不启用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left">可编辑否:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<select class="form-control input-sm shortInput" name="dictEdit">
|
||||
<option value="1" <c:if test="${dict.dictEdit == 1}">selected</c:if>>是</option>
|
||||
<option value="0" <c:if test="${dict.dictEdit == 0}">selected</c:if>>否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label left"> 备注:</label>
|
||||
<div class="col-sm-5 left">
|
||||
<textarea type="text" class="form-control input-sm" name="remark" value="${dict.remark}" maxlength="50">${dict.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${hospital.dictEdit == 1 || user.roleId == 0}">
|
||||
<div class="btns">
|
||||
<pm:myPermissions permissions="/dict/update">
|
||||
<button type="button" class="btn btn-primary input-sm" onclick="addSys()">保存</button>
|
||||
</pm:myPermissions>
|
||||
<button type="button" class="btn btn-default input-sm" onclick="clearForm2()">清空</button>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<script src="${path}/static/js/dictIframe.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,16 @@
|
||||
<label for="re_parentId" class="control-label">父节点:</label>
|
||||
<div class=" form-group form-inline">
|
||||
<div>
|
||||
<input id="txtTreeSelect1" type="text" onclick="showMenu1(); return false;"
|
||||
class="form-control" placeholder="父节点"
|
||||
id="re_parentId" name="re_parentId"
|
||||
data-id=""
|
||||
readonly="readonly"
|
||||
/>
|
||||
</div>
|
||||
<div id="menuContent1" class="menuContent" style="display: none;background: #f9f9f9;
|
||||
position: absolute;z-index: 10">
|
||||
<ul id="treeDemo1" class="ztree" style="margin-top: 0; width: 178px;">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,558 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>嘉时软件</title>
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<link rel="stylesheet" href="${path}/static/css/gatewayPageStyles.css"/>
|
||||
<script src="${path}/static/js/echarts/echarts.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.logo{
|
||||
height: 59px!important;
|
||||
}
|
||||
.navbar-custom-menu{
|
||||
padding-right:17px;
|
||||
}
|
||||
/**
|
||||
* 内容背景颜色
|
||||
*/
|
||||
.content-wrapper{
|
||||
background-color: #fff!important;
|
||||
}
|
||||
/**
|
||||
* 上图标div
|
||||
*/
|
||||
.header{
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
margin-top: 0!important;
|
||||
}
|
||||
.headerLeft{
|
||||
width:70px;
|
||||
height:100%;
|
||||
}
|
||||
.iconContext{
|
||||
width:104px;
|
||||
height:100%;
|
||||
margin-left: 35px;
|
||||
}
|
||||
/**
|
||||
* 字内容div背景颜色
|
||||
*/
|
||||
.content-header{
|
||||
background-color: #ecf0f5!important;
|
||||
padding: 0!important;
|
||||
}
|
||||
/**
|
||||
* echartDiv
|
||||
*/
|
||||
.echartsSection{
|
||||
background-color: #ecf0f5!important;
|
||||
margin-top: 10px;
|
||||
width:100%;
|
||||
height: 566px;
|
||||
}
|
||||
/**
|
||||
* 上组图div
|
||||
*/
|
||||
.topEchartsDiv{
|
||||
padding:0!important;
|
||||
width:100%;
|
||||
height:50%;
|
||||
}
|
||||
/**
|
||||
* 下组图div
|
||||
*/
|
||||
.bottomEchartsDiv{
|
||||
padding:0!important;
|
||||
width:100%;
|
||||
height:50%;
|
||||
}
|
||||
/**
|
||||
* 系统操作div
|
||||
*/
|
||||
.systemOperDiv{
|
||||
width:33%;
|
||||
height: 100%;
|
||||
}
|
||||
/**
|
||||
* 在线用户统计div
|
||||
*/
|
||||
.alineDiv{
|
||||
margin-left: 1%;
|
||||
width:66%;
|
||||
height: 100%;
|
||||
}
|
||||
/**
|
||||
* 在线用户里内容div
|
||||
*/
|
||||
.topEchartsRightDiv{
|
||||
width:48%;
|
||||
height: 88%;
|
||||
}
|
||||
/**
|
||||
* 在线用户里内容右div
|
||||
*/
|
||||
.topEchartsRightDiv2{
|
||||
margin-left:15px;
|
||||
}
|
||||
/**
|
||||
* 下组图内容div
|
||||
*/
|
||||
.bottomEchartsContentDiv{
|
||||
width:31%;
|
||||
height: 88%;
|
||||
}
|
||||
/**
|
||||
* 下组图内容div非左div
|
||||
*/
|
||||
.bottomEchartsContentNotLeftDiv{
|
||||
margin-left: 25px;
|
||||
}
|
||||
/**
|
||||
* echart头标题div
|
||||
*/
|
||||
.echartsHeader{
|
||||
background-color: #3C8DBC;
|
||||
width: 100%;
|
||||
height:12%;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
padding-top:3px;
|
||||
}
|
||||
hr{
|
||||
margin: 0!important;
|
||||
}
|
||||
#alineLineDivMain canvas{
|
||||
heigth:120%;
|
||||
}
|
||||
#alineBarDivMain canvas{
|
||||
heigth:120%;
|
||||
}
|
||||
/*#serverListenGaugeDiv1 canvas{*/
|
||||
/*width:120%!important;*/
|
||||
/*height:120%!important;*/
|
||||
/*}*/
|
||||
.hidden-xs{
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<%--<a href="http://192.168.1.3:8080/emr_record/login?token=IxEQVDobAlREQlRFQk5HTE5BRFQ3JyBURkRFTQ==&userName=1137">hhhhhhhhhhhhhhhh</a>--%>
|
||||
<input type="hidden" id="userId" value="${CURRENT_USER.userId}">
|
||||
<input type="hidden" id="webSocketUrl" value="${WEBSOCKET_URLHEAD}">
|
||||
<input type="hidden" id="strSplit" value="${STR_SPLIT}">
|
||||
<input type="hidden" id="flag" value="${flag}">
|
||||
<div class="wrapper">
|
||||
<header class="main-header">
|
||||
<!--logo-->
|
||||
<div class=" logo">
|
||||
<%--<div class="pull-left image" style="align-content: baseline;">
|
||||
<img src="${path}/static/bootstrap-3.3.7/dist/img/credit/paypal.png"
|
||||
style=":height:70%;width: 70%;margin-top:0.25rem;"
|
||||
class="user-image" alt="User Image">
|
||||
</div>--%>
|
||||
<div class="pull-left info" style="width: 100%">
|
||||
<p>嘉时软件</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="navbar navbar-static-top">
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="noticeManage()">
|
||||
<span class="label label-warning" id="noticeCount">0</span>
|
||||
<i class="fa fa-envelope-o" style="font-size: 25px;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="${path}/static/bootstrap-3.3.7/dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
|
||||
<c:choose>
|
||||
<c:when test="${CURRENT_USER.powerDepts == '' || CURRENT_USER.powerDepts == null || CURRENT_USER.powerDepts == 'null'}">
|
||||
<c:choose>
|
||||
<c:when test="${CURRENT_USER.name != null && CURRENT_USER.name != '' && CURRENT_USER.name != 'null'}">
|
||||
<p class="hidden-xs" title="${CURRENT_USER.name}">${CURRENT_USER.name}</p>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<p class="hidden-xs" title="${CURRENT_USER.userName}">${CURRENT_USER.userName}</p>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:choose>
|
||||
<c:when test="${CURRENT_USER.name != null && CURRENT_USER.name != '' && CURRENT_USER.name != 'null'}">
|
||||
<p class="hidden-xs" title="${CURRENT_USER.name}(${CURRENT_USER.powerDepts})">${CURRENT_USER.name}(${CURRENT_USER.powerDepts})</p>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<p class="hidden-xs" title="${CURRENT_USER.userName}(${CURRENT_USER.powerDepts})">${CURRENT_USER.userName}(${CURRENT_USER.powerDepts})</p>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<div class="margin">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default">操作</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
|
||||
aria-expanded="false" style="height:34px">
|
||||
<span class="caret"></span>
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<%--<li><a href="#">帮助</a></li>
|
||||
<li><a href="#">联系我们</a></li>
|
||||
<li><a href="${path}/gatewayPage">返回首页</a></li>
|
||||
<li class="divider"></li>--%>
|
||||
<li><a href="${path}/logout?token=${token}">退出登录</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</header>
|
||||
<aside class="main-sidebar">
|
||||
<div onclick="mainManage()" style="cursor:pointer">
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u86" class="ax_default icon">
|
||||
<img id="u86_img" class="img " src="${path}/static/images/门户页面/u86.png"/>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u158" class="ax_default _三级标题">
|
||||
<div id="u158_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u159" class="text" style="visibility: visible;">
|
||||
<p><span>主页</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Unnamed (组合) -->
|
||||
<div onclick="noticeManage()" style="cursor:pointer">
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u161" class="ax_default icon">
|
||||
<img id="u161_img" class="img " src="${path}/static/images/门户页面/u161.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u162" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u163" class="ax_default _三级标题">
|
||||
<div id="u163_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u164" class="text" style="visibility: visible;">
|
||||
<p><span>通知信息</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="helpDocumentManage()" style="cursor:pointer">
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u152" class="ax_default icon">
|
||||
<img id="u152_img" class="img " src="${path}/static/images/门户页面/u152.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u153" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u165" class="ax_default _三级标题">
|
||||
<div id="u165_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u166" class="text" style="visibility: visible;">
|
||||
<p><span>帮助文档</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="updatePassword()" style="cursor:pointer">
|
||||
<!-- Unnamed (形状)/user/toUpdatePassword -->
|
||||
<div id="u154" class="ax_default icon">
|
||||
<img id="u154_img" class="img " src="${path}/static/images/门户页面/u154.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u155" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u167" class="ax_default _三级标题">
|
||||
<div id="u167_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u168" class="text" style="visibility: visible;">
|
||||
<p><span>修改密码</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div onclick="callMeManage()" style="cursor:pointer">
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u156" class="ax_default icon">
|
||||
<img id="u156_img" class="img " src="${path}/static/images/门户页面/u156.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u157" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u169" class=" _三级标题">
|
||||
<div id="u169_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u170" class="text" style="visibility: visible;">
|
||||
<p><span>联系我们</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
<div id="iframeDiv" style="display: none">
|
||||
<iframe class="row-fluid" style="margin-left:230px;height:100%;width:85%;"
|
||||
id="iframe" name="iframe" scrolling="no" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="content-wrapper" id="sectionDiv">
|
||||
<section class="content-header">
|
||||
<div class="header">
|
||||
<div class="headerLeft left">
|
||||
<a href="#">
|
||||
<div id="u191" class="ax_default box_1">
|
||||
<div id="u191_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u192" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="u187" class="ax_default icon">
|
||||
<img id="u187_img" class="img " src="${path}/static/images/门户页面/u187.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u188" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<c:if test="${power == 1}">
|
||||
<div class="iconContext left">
|
||||
<a href="${path}/index">
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u128" class="ax_default sticky_2">
|
||||
<div id="u128_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u129" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u130" class="ax_default icon">
|
||||
<img id="u130_img" class="img " src="${path}/static/images/门户页面/u130.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u131" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u132" class="ax_default _二级标题">
|
||||
<div id="u132_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u133" class="text" style="visibility: visible;">
|
||||
<p><span>权限系统</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${emr_medical_record == 1}">
|
||||
<div class="iconContext left">
|
||||
<a href="${EMRMEDICALRECORD_URLHEAD}/login?token=${token}&userName=${CURRENT_USER.userName}">
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u134" class="ax_default sticky_2">
|
||||
<div id="u134_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u135" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u136" class="ax_default icon">
|
||||
<img id="u136_img" class="img " src="${path}/static/images/门户页面/u136.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u137" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u138" class="ax_default _二级标题">
|
||||
<div id="u138_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u139" class="text" style="visibility: visible;text-align: center">
|
||||
<p><span>病案归档系统</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${emr_record == 1}">
|
||||
<div class="iconContext left">
|
||||
<a href="${EMRRECORD_URLHEAD}/login?token=${token}&userName=${CURRENT_USER.userName}">
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u140" class="ax_default sticky_3">
|
||||
<div id="u140_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u141" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u142" class="ax_default icon">
|
||||
<img id="u142_img" class="img " src="${path}/static/images/门户页面/u138.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u143" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u144" class="ax_default _二级标题">
|
||||
<div id="u144_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u145" class="text" style="visibility: visible;text-align: center">
|
||||
<p><span>档案管理系统</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</c:if>
|
||||
<%--<c:if test="${emr_apply_copy == 1}">
|
||||
<div class="iconContext left">
|
||||
<a href="${EMRAPPLYCOPY_URLHEAD}/auth/login?token=${token}&userName=${CURRENT_USER.userName}">
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u146" class="ax_default sticky_3">
|
||||
<div id="u146_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u147" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u148" class="ax_default icon">
|
||||
<img id="u148_img" class="img " src="${path}/static/images/门户页面/u149.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u149" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u150" class="ax_default _二级标题">
|
||||
<div id="u150_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u151" class="text" style="visibility: visible;text-align: center">
|
||||
<p><span>病案复印预约</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${emr_files == 1}">
|
||||
<div class="iconContext left">
|
||||
<a href="${EMRFILES_URLHEAD}/login?token=${token}&userName=${CURRENT_USER.userName}">
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u1461" class="ax_default sticky_3">
|
||||
<div id="u1461_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u1471" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (形状) -->
|
||||
<div id="u1481" class="ax_default icon">
|
||||
<img id="u1481_img" class="img " src="${path}/static/images/门户页面/u148.png"/>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u1491" class="text" style="display: none; visibility: hidden">
|
||||
<p><span></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Unnamed (矩形) -->
|
||||
<div id="u1501" class="ax_default _二级标题">
|
||||
<div id="u1501_div" class=""></div>
|
||||
<!-- Unnamed () -->
|
||||
<div id="u1511" class="text" style="visibility: visible;text-align: center">
|
||||
<p><span>病案签收</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</c:if>--%>
|
||||
</div>
|
||||
</section>
|
||||
<%--<section class="content-bottom echartsSection">
|
||||
<!--上echarts-->
|
||||
<div class="topEchartsDiv" style="background-color: #fff">
|
||||
<!--系统操作div-->
|
||||
<div class="systemOperDiv left">
|
||||
<div class="echartsHeader">
|
||||
<span>权限系统操作</span>
|
||||
</div>
|
||||
<div id="systemOperDivMain" style="width:100%;height:100%;"></div>
|
||||
</div>
|
||||
<!--统计用户在线div-->
|
||||
<div class="alineDiv left" style="background-color: #fff">
|
||||
<div class="echartsHeader">
|
||||
<span>在线人数统计</span>
|
||||
</div>
|
||||
<div class="topEchartsRightDiv left">
|
||||
<div style="width:100%;height: 11%;"><span style="font-size: 16px">本月客户阶段统计(客户总量:<span id="maxCountList"></span>)</span><hr style="color: grey"></div>
|
||||
<div id="alineLineDivMain" style="width:100%;height:89%;"></div>
|
||||
</div>
|
||||
<div class="topEchartsRightDiv topEchartsRightDiv2 left">
|
||||
<div style="width:100%;height: 11%;text-align: right"><span style="font-size: 16px;padding-right: 35px">总拜访量:<span id="loginCount"></span></span></div>
|
||||
<div id="alineBarDivMain" style="width:100%;height:89%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomEchartsDiv">
|
||||
<div class="echartsHeader">
|
||||
<span>服务器监控</span>
|
||||
</div>
|
||||
<div class="bottomEchartsContentDiv left">
|
||||
<div id="serverListenGaugeDiv1" style="width:100%;height:100%;"></div>
|
||||
</div>
|
||||
<div class="bottomEchartsContentDiv left bottomEchartsContentNotLeftDiv">
|
||||
<div id="serverListenGaugeDiv2" style="width:100%;height:100%;"></div>
|
||||
</div>
|
||||
<div class="bottomEchartsContentDiv left bottomEchartsContentNotLeftDiv">
|
||||
<div id="serverListenGaugeDiv3" style="width:100%;height:100%;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>--%>
|
||||
</div>
|
||||
<!-- 底部版权-->
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b>Version</b> 20200211
|
||||
</div>
|
||||
<strong>Copyright © 2019-2090 厦门嘉时软件.</strong> All rights
|
||||
reserved.
|
||||
</footer>
|
||||
</div>
|
||||
<script type="text/javascript" src="${path}/static/js/getewayIndex.js?time=2019-12-15"></script>
|
||||
<%@ include file="/WEB-INF/jspf/webSocket.jspf" %>
|
||||
<%--<script src="${path}/static/js/gatewayIndexEcharts.js"></script>--%>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,290 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>嘉时软件</title>
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
</head>
|
||||
<script type="text/javascript">
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style>
|
||||
.indexSelected{
|
||||
background-color: #42515F;
|
||||
}
|
||||
.navbar-custom-menu{
|
||||
padding-right:17px;
|
||||
}
|
||||
.hidden-xs{
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.logo{
|
||||
height: 59px!important;
|
||||
}
|
||||
</style>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<input type="hidden" id="userId" value="${CURRENT_USER.userId}">
|
||||
<input type="hidden" id="webSocketUrl" value="${WEBSOCKET_URLHEAD}">
|
||||
<input type="hidden" id="strSplit" value="${STR_SPLIT}">
|
||||
<div class="wrapper">
|
||||
|
||||
<header class="main-header">
|
||||
<!--logo-->
|
||||
<div class="logo">
|
||||
<div class="pull-left info" style="width: 100%">
|
||||
<p>嘉时软件</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="navbar navbar-static-top">
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="noticeManage1(-1)">
|
||||
<span class="label label-warning" id="noticeCount">0</span>
|
||||
<i class="fa fa-envelope-o" style="font-size: 25px;"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="${path}/static/bootstrap-3.3.7/dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
|
||||
<c:choose>
|
||||
<c:when test="${CURRENT_USER.powerDepts == '' || CURRENT_USER.powerDepts == null || CURRENT_USER.powerDepts == 'null'}">
|
||||
<c:choose>
|
||||
<c:when test="${CURRENT_USER.name != null && CURRENT_USER.name != '' && CURRENT_USER.name != 'null'}">
|
||||
<p class="hidden-xs" title="${CURRENT_USER.name}">${CURRENT_USER.name}</p>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<p class="hidden-xs" title="${CURRENT_USER.userName}">${CURRENT_USER.userName}</p>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:choose>
|
||||
<c:when test="${CURRENT_USER.name != null && CURRENT_USER.name != '' && CURRENT_USER.name != 'null'}">
|
||||
<p class="hidden-xs" title="${CURRENT_USER.name}(${CURRENT_USER.powerDepts})">${CURRENT_USER.name}(${CURRENT_USER.powerDepts})</p>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<p class="hidden-xs" title="${CURRENT_USER.userName}(${CURRENT_USER.powerDepts})">${CURRENT_USER.userName}(${CURRENT_USER.powerDepts})</p>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<div class="margin">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default">操作</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
|
||||
aria-expanded="false" style="height:34px">
|
||||
<span class="caret"></span>
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<%--<li><a href="#">帮助</a></li>
|
||||
<li><a href="#">联系我们</a></li>--%>
|
||||
<li><a href="${path}/gatewayPage">返回首页</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="${path}/logout?token=${token}">退出登录</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<aside class="main-sidebar">
|
||||
<section class="sidebar">
|
||||
<!-- 查询菜单列表 -->
|
||||
<!--<form action="#" method="get" class="sidebar-form">
|
||||
<div class="input-group">
|
||||
<input type="text" name="q" class="form-control" placeholder="Search...">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>-->
|
||||
<!-- 菜单列表-->
|
||||
<ul id="indexTreeMenu" class="sidebar-menu" data-widget="tree">
|
||||
<%--<li class="header">菜单列表</li>--%>
|
||||
<%--<li class="active treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-dashboard"></i> <span>基本功能</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li class="active"><a href="${path}/paper/allPaper" target="iFrame1"><i class="icon-user"></i>测试管理</a>
|
||||
</li>
|
||||
<li><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>用户管理</a></li>
|
||||
<li><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>角色管理</a></li>
|
||||
<li><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>科室管理</a></li>
|
||||
<li><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>归属管理</a></li>
|
||||
>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-circle-o"></i> <span>配置管理</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li class="active"><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>用户分配菜单</a></li>
|
||||
<li><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>角色分配菜单</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-dashboard"></i> <span>维护管理</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li class="active"><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>维护管理</a></li>
|
||||
<li><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>使用说明</a></li>
|
||||
<li><a href="${path}/index1.jsp"><i class="fa fa-circle-o"></i>联系我们</a></li>
|
||||
</ul>
|
||||
</li>--%>
|
||||
<!--测试-->
|
||||
<%--<li class="treeview menu-open">
|
||||
<a href="#">
|
||||
<i class="fa fa-share"></i> <span>医院名称</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu" style="display: block;">
|
||||
<li class="treeview">
|
||||
<a href="#"><i class="fa fa-circle-o"></i>基本功能
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="treeview-menu" style="display: block;">
|
||||
<li class="treeview">
|
||||
<a href="#"><i class="fa fa-circle-o"></i>基本功能
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
<li class="treeview menu-open">
|
||||
<a href="#">
|
||||
<i class="fa fa-share"></i> <span>Multilevel</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu" style="display: block;">
|
||||
<li class="treeview menu-open">
|
||||
<a href="#"><i class="fa fa-circle-o"></i> Level One
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu" style="display: block;">
|
||||
<li class="treeview">
|
||||
<a href="#"><i class="fa fa-circle-o"></i> Level Two
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview menu-open">
|
||||
<a href="#"><i class="fa fa-circle-o"></i> Level One
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu" style="display: block;">
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Two</a></li>
|
||||
<li class="treeview">
|
||||
<a href="#"><i class="fa fa-circle-o"></i> Level Two
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
<li><a href="#"><i class="fa fa-circle-o"></i> Level Three</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>--%>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
</aside>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<section class="content">
|
||||
<!-- 内容 src="${path}/user/pageUI"-->
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<iframe class="row-fluid" style="height:100%;width:100%;" src="${path}/user/pageUI"
|
||||
id="iFrame1" name="iFrame1" scrolling="no" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<!-- 底部版权-->
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b>Version</b> 20200211
|
||||
</div>
|
||||
<strong>Copyright © 2019-2090 厦门嘉时软件.</strong> All rights
|
||||
reserved.
|
||||
</footer>
|
||||
</div>
|
||||
<%@ include file="/WEB-INF/jspf/webSocket.jspf" %>
|
||||
<script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,22 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>My JSP 'index.jsp' starting page</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<link rel="stylesheet" href="${path }/static/css/layui.css" media="all" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 代码 开始 -->
|
||||
<div >
|
||||
<blockquote class="layui-elem-quote">待开发!</blockquote>
|
||||
</div>
|
||||
<!-- 代码 结束 -->
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,151 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>角色菜单权限</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<link rel="stylesheet" href="${path}/static/zTree_v3-master/css/demo.css" type="text/css">
|
||||
<link rel="stylesheet" href="${path}/static/zTree_v3-master/css/zTreeStyle/zTreeStyle.css" type="text/css">
|
||||
<script src="${path}/static/zTree_v3-master/js/jquery.ztree.all.js"></script>
|
||||
<script src="${path}/static/zTree_v3-master/js/jquery.ztree.exhide.js"></script>
|
||||
<script>
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.widget-header{
|
||||
height:26px;
|
||||
background-color: #1D9ED7;
|
||||
}
|
||||
.searcDiv{
|
||||
margin-top: 5px;
|
||||
height: 30px;
|
||||
}
|
||||
.form-group{
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
.form-control{
|
||||
margin: 0 auto;
|
||||
}
|
||||
.treeBtn{
|
||||
margin-top:10px;
|
||||
padding-left:19%;
|
||||
}
|
||||
.btn{
|
||||
margin-left:8%;
|
||||
}
|
||||
.ztree{
|
||||
border: 0px!important;
|
||||
background-color: #fff!important;
|
||||
overflow: auto!important;
|
||||
font-size: 14rem!important;
|
||||
height:80%!important;
|
||||
width: 78%!important;
|
||||
}
|
||||
.zTreeDemo{
|
||||
margin-left:10%;
|
||||
}
|
||||
.buttonDiv{
|
||||
width: 10%;
|
||||
height: 10%;
|
||||
position: fixed;
|
||||
right: 3%;
|
||||
top: 70%;
|
||||
}
|
||||
.restore{
|
||||
width:100px!important;
|
||||
}
|
||||
/*h1{
|
||||
margin-left:-80%;
|
||||
}*/
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<%--<div class="row">
|
||||
<h1>
|
||||
授权管理/角色分配菜单
|
||||
</h1>
|
||||
</div>--%>
|
||||
<div class="row">
|
||||
<input type="hidden" id="roleId" name="roleId">
|
||||
<input type="hidden" id="sysFlag" name="sysFlag">
|
||||
<input type="hidden" id="menus" name="menus">
|
||||
<input type="hidden" id="methods">
|
||||
<%--<div class="row">
|
||||
<h1 style="text-align:left">
|
||||
基本管理/用户管理
|
||||
</h1>
|
||||
</div>--%>
|
||||
<!--节点menuId-->
|
||||
<input type="hidden" id="divIndex">
|
||||
<!--角色树-->
|
||||
<div class="col-sm-3">
|
||||
<div class="">
|
||||
<div class="widget-header">
|
||||
<h2> </h2>
|
||||
</div>
|
||||
<div class="searcDiv">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-9 control-label"><input type="text" class="form-control input-sm" id="key" maxlength="16" placeholder="角色名"></label>
|
||||
<div class="col-sm-3">
|
||||
<button type="button" class="btn btn-sm btn-primary left" onclick="reloadTree()">搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="treeBtn">
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="expandAll();">全部展开</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="collapseAll();">全部折叠</button>
|
||||
</div>
|
||||
<div class="zTreeDemo">
|
||||
<ul id="ztree" class="ztree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--菜单树-->
|
||||
<div class="col-sm-3">
|
||||
<div class="">
|
||||
<div class="widget-header">
|
||||
<h2> </h2>
|
||||
</div>
|
||||
<div class="searcDiv">
|
||||
<input type="text" id="key1" value="" class="form-control input-sm"
|
||||
placeholder="菜单名称" maxlength="16" style="width:80%"/><br/>
|
||||
</div>
|
||||
<div class="treeBtn">
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="expandAll1();">全部展开</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="collapseAll1();">全部折叠</button>
|
||||
</div>
|
||||
<div class="zTreeDemo" style="margin-left:60px">
|
||||
<ul id="ztree1" class="ztree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--方法区-->
|
||||
<div class="col-sm-6" >
|
||||
<div class="">
|
||||
<div class="widget-header">
|
||||
<h2> </h2>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<div class="widget-main">
|
||||
<div id="block">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttonDiv">
|
||||
<pm:myPermissions permissions="/menuPower/addRoleMenu">
|
||||
<button type="button" class="btn btn-primary btn-sm restore" onclick="addMenu()">保存</button>
|
||||
</pm:myPermissions>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.main-container -->
|
||||
<script src="${path}/static/js/menu/rolePowerList.js"></script>
|
||||
<script src="${path}/static/js/menu/userAndRoleComment.js"></script>
|
||||
<script src="${path}/static/js/menu/fuzzysearch.js"></script>
|
||||
<%@ include file="/WEB-INF/jspf/loading.jspf" %>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,138 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>用户菜单菜单</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<link rel="stylesheet" href="${path}/static/zTree_v3-master/css/demo.css" type="text/css">
|
||||
<link rel="stylesheet" href="${path}/static/zTree_v3-master/css/zTreeStyle/zTreeStyle.css" type="text/css">
|
||||
<script src="${path}/static/zTree_v3-master/js/jquery.ztree.all.js"></script>
|
||||
<script src="${path}/static/zTree_v3-master/js/jquery.ztree.exhide.js"></script>
|
||||
<script>
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.widget-header{
|
||||
height:26px;
|
||||
background-color: #1D9ED7;
|
||||
}
|
||||
.searcDiv{
|
||||
margin-top: 5px;
|
||||
height: 30px;
|
||||
}
|
||||
.form-group{
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
.form-control{
|
||||
margin: 0 auto;
|
||||
}
|
||||
.treeBtn{
|
||||
margin-top:10px;
|
||||
padding-left:19%;
|
||||
}
|
||||
.btn{
|
||||
margin-left:8%;
|
||||
}
|
||||
.ztree{
|
||||
border: 0px!important;
|
||||
background-color: #fff!important;
|
||||
overflow: auto!important;
|
||||
font-size: 14rem!important;
|
||||
height:70%!important;
|
||||
width: 100%!important;
|
||||
}
|
||||
.zTreeDemo{
|
||||
margin-left:10%;
|
||||
}
|
||||
.buttonDiv{
|
||||
width: 10%;
|
||||
height: 10%;
|
||||
position: fixed;
|
||||
right: 3%;
|
||||
top: 70%;
|
||||
}
|
||||
.restore{
|
||||
width:100px!important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<input type="hidden" id="userId" name="userId">
|
||||
<input type="hidden" id="sysFlag" name="sysFlag">
|
||||
<input type="hidden" id="menus" name="menus">
|
||||
<input type="hidden" id="methods">
|
||||
<!--节点menuId-->
|
||||
<input type="hidden" id="divIndex">
|
||||
<div class="row">
|
||||
<!--用户树-->
|
||||
<div class="col-sm-3">
|
||||
<div>
|
||||
<div class="widget-header">
|
||||
<h2> </h2>
|
||||
</div>
|
||||
<div class="searcDiv">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-9 control-label"><input type="text" class="form-control input-sm" id="key" maxlength="11" placeholder="ID-用户名(手机号)"></label>
|
||||
<div class="col-sm-3">
|
||||
<button type="button" class="btn btn-sm btn-primary left" onclick="reloadTree()">搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="treeBtn">
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="expandAll();">全部展开</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="collapseAll();">全部折叠</button>
|
||||
</div>
|
||||
<div id="zTreeDemo" class="zTreeDemo">
|
||||
<ul id="ztree" class="ztree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--菜单树-->
|
||||
<div class="col-sm-3">
|
||||
<div class="">
|
||||
<div class="widget-header">
|
||||
<h2> </h2>
|
||||
</div>
|
||||
<div class="searcDiv">
|
||||
<input type="text" id="key1" value="" class="form-control input-sm"
|
||||
placeholder="菜单名称" maxlength="16" style="width:80%"/>
|
||||
</div>
|
||||
<div class="treeBtn">
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="expandAll1();">全部展开</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="collapseAll1();">全部折叠</button>
|
||||
</div>
|
||||
<div class="zTreeDemo">
|
||||
<ul id="ztree1" class="ztree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--方法区-->
|
||||
<div class="col-sm-6">
|
||||
<div class="">
|
||||
<div class="widget-header">
|
||||
<h2> </h2>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<div class="widget-main">
|
||||
<div id="block"></div>
|
||||
</div>
|
||||
<div class="buttonDiv">
|
||||
<pm:myPermissions permissions="/menuPower/addUserMenu">
|
||||
<button type="button" class="btn btn-primary btn-sm restore" onclick="addUserMenu()">保存</button>
|
||||
</pm:myPermissions>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.main-container -->
|
||||
<script src="${path}/static/js/menu/userPowerList.js"></script>
|
||||
<script src="${path}/static/js/menu/userAndRoleComment.js"></script>
|
||||
<script src="${path}/static/js/menu/fuzzysearch.js"></script>
|
||||
<%@ include file="/WEB-INF/jspf/loading.jspf" %>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,181 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<c:set var="path" value="${pageContext.request.contextPath}"/>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>其他管理</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
|
||||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin-right: -15px;
|
||||
margin-bottom: -15px;
|
||||
}
|
||||
.panel-heading{
|
||||
padding: 0 16px;
|
||||
|
||||
}
|
||||
hr{
|
||||
margin:0;
|
||||
}
|
||||
/**搜索区*/
|
||||
.searchDiv {
|
||||
margin-top: 5px;
|
||||
width:100%;
|
||||
height: 30px;
|
||||
}
|
||||
.dateSearchDiv{
|
||||
width:29%;
|
||||
}
|
||||
.dateSearchInput{
|
||||
width:30%;
|
||||
margin-left:2%;
|
||||
}
|
||||
.dateLabelDiv{
|
||||
width: 30%;
|
||||
text-align: right;
|
||||
}
|
||||
.searchInput{
|
||||
width:19%;
|
||||
margin-left: 2%;
|
||||
}
|
||||
.searchElement{
|
||||
width: 42%;
|
||||
}
|
||||
.searchInputElement{
|
||||
width: 58%;
|
||||
}
|
||||
.labelDiv{
|
||||
padding-top:3px;
|
||||
margin-left: 2%;
|
||||
}
|
||||
/**查询按钮组*/
|
||||
.btnsDiv{
|
||||
width: 100%;
|
||||
height:32px;
|
||||
text-align: right;
|
||||
padding-top:5px;
|
||||
}
|
||||
.pagination{
|
||||
margin:0!important;
|
||||
}
|
||||
/**表格div*/
|
||||
.tableDiv{
|
||||
margin-left:14px;
|
||||
margin-top: -9px!important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<%--<div class="headDiv">--%>
|
||||
<%--<div class="headSpanDiv">--%>
|
||||
<%--<span class="headspan">--%>
|
||||
<%--日志管理--%>
|
||||
<%--</span>--%>
|
||||
<%--</div>--%>
|
||||
<%--</div>--%>
|
||||
<div class="">
|
||||
<div class="panel-heading"><h4>其他管理/日志管理</h4></div>
|
||||
<hr>
|
||||
<!-- tab标签 -->
|
||||
<%--<ul id="tab" class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#tab1" data-toggle="tab">
|
||||
数据库备份
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#tab2" data-toggle="tab">
|
||||
日志管理
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#tab3" data-toggle="tab">
|
||||
通知管理
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- 每个tab页对应的内容 -->
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade in active" id="tab1">
|
||||
<p>数据库备份</p>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="tab2">--%>
|
||||
<div class="searchDiv">
|
||||
<div class="searchInput left" style="margin-left: 14px">
|
||||
<div class="searchElement left">
|
||||
<label class="labelDiv">日志主题:</label>
|
||||
</div>
|
||||
<div class="searchInputElement left">
|
||||
<input type="text" class="form-control input-sm" id="logTitle">
|
||||
</div>
|
||||
</div>
|
||||
<div class="searchInput left">
|
||||
<div class="searchElement left">
|
||||
<label class="labelDiv">日志内容:</label>
|
||||
</div>
|
||||
<div class="searchInputElement left">
|
||||
<input type="text" class="form-control input-sm" id="logContent">
|
||||
</div>
|
||||
</div>
|
||||
<div class="searchInput left">
|
||||
<div class="searchElement left">
|
||||
<label class="labelDiv">操作人:</label>
|
||||
</div>
|
||||
<div class="searchInputElement left">
|
||||
<input type="text" class="form-control input-sm" id="creater">
|
||||
</div>
|
||||
</div>
|
||||
<div class="dateSearchDiv left">
|
||||
<div class="dateLabelDiv left">
|
||||
<label class="labelDiv">操作时间:</label>
|
||||
</div>
|
||||
<div class="dateSearchInput left">
|
||||
<input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间">
|
||||
</div>
|
||||
<div class="dateSearchInput left">
|
||||
<input type="text" class="form-control input-sm" id="endTime1" placeholder="结束时间">
|
||||
</div>
|
||||
</div>
|
||||
<div class="left">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnsDiv">
|
||||
<pm:myPermissions permissions="/otherManage/exportExcel">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="exportExcel()"><i class="fa fa-reply"></i>导出</button>
|
||||
</pm:myPermissions>
|
||||
<pm:myPermissions permissions="/otherManage/deleteLogByIds">
|
||||
<button type="button" class="btn btn-sm btn-danger" onclick="deleteLogByIds()">批量删除</button>
|
||||
</pm:myPermissions>
|
||||
</div>
|
||||
<!--数据表格-->
|
||||
<div class="tableDiv">
|
||||
<input type="hidden" id="checks">
|
||||
<table id="bootstrapTable" class="table text-nowrap table-bordered"></table>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="tab-pane fade" id="tab3">
|
||||
<p>通知管理</p>
|
||||
</div>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="${path}/static/js/otherManage/backupDatabase.js?t=2222"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,22 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>My JSP 'index.jsp' starting page</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<link rel="stylesheet" href="${path }/static/css/layui.css" media="all" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 代码 开始 -->
|
||||
<div >
|
||||
<blockquote class="layui-elem-quote">您无权访问此位置!</blockquote>
|
||||
</div>
|
||||
<!-- 代码 结束 -->
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,53 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: ljx
|
||||
Date: 2019/5/13
|
||||
Time: 17:02
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>修改密码</title>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
</head>
|
||||
<body>
|
||||
<form class="form-horizontal" role="form">
|
||||
<fieldset>
|
||||
<legend style="text-align: center;font-weight: bold;font-size: 25px">修改密码</legend>
|
||||
</fieldset>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="userPwd" class="col-sm-2 control-label">旧密码</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="password" class="form-control" readonly value="${user.userPwd}" id="userPwd"
|
||||
placeholder="请输入旧密码">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newUserPwd" class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="password" class="form-control" id="newUserPwd" name="newUserPwd"
|
||||
placeholder="请输入新密码" maxlength="16">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newReUserPwd" class="col-sm-2 control-label">重复密码</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="password" class="form-control" id="newReUserPwd"
|
||||
placeholder="请输入重复密码" maxlength="16">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="button" class="btn btn-primary" id="btn_submit">提交更改</button>
|
||||
<button type="button" class="btn btn-default" id="btn_clear">清空</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</body>
|
||||
<script src="${path}/static/js/updatePassword.js?t=1"></script>
|
||||
</html>
|
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @author: YL
|
||||
* @version: v1.0.0
|
||||
*/
|
||||
!function ($) {
|
||||
'use strict';
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
treeShowField: null,
|
||||
idField: 'id',
|
||||
parentIdField: 'pid',
|
||||
onGetNodes: function (row, data) {
|
||||
var that = this;
|
||||
var nodes = [];
|
||||
$.each(data, function (i, item) {
|
||||
if (row[that.options.idField] === item[that.options.parentIdField]) {
|
||||
nodes.push(item);
|
||||
}
|
||||
});
|
||||
return nodes;
|
||||
},
|
||||
onCheckRoot: function (row, data) {
|
||||
var that = this;
|
||||
return !row[that.options.parentIdField];
|
||||
}
|
||||
});
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_initRow = BootstrapTable.prototype.initRow,
|
||||
_initHeader = BootstrapTable.prototype.initHeader;
|
||||
|
||||
// td
|
||||
BootstrapTable.prototype.initHeader = function () {
|
||||
var that = this;
|
||||
_initHeader.apply(that, Array.prototype.slice.apply(arguments));
|
||||
var treeShowField = that.options.treeShowField;
|
||||
if (treeShowField) {
|
||||
$.each(this.header.fields, function (i, field) {
|
||||
if (treeShowField === field) {
|
||||
that.treeEnable = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initTr = function (item, idx, data, parentDom) {
|
||||
var that = this;
|
||||
var nodes = that.options.onGetNodes.apply(that, [item, data]);
|
||||
item._nodes = nodes;
|
||||
parentDom.append(_initRow.apply(that, [item, idx, data, parentDom]));
|
||||
|
||||
// init sub node
|
||||
var len = nodes.length - 1;
|
||||
for (var i = 0; i <= len; i++) {
|
||||
var node = nodes[i];
|
||||
node._level = item._level + 1;
|
||||
node._parent = item;
|
||||
if (i === len)
|
||||
node._last = 1;
|
||||
// jquery.treegrid.js
|
||||
that.options.rowStyle = function (item, idx) {
|
||||
var id = item[that.options.idField] ? item[that.options.idField] : 0;
|
||||
var pid = item[that.options.parentIdField] ? item[that.options.parentIdField] : 0;
|
||||
return {
|
||||
classes: 'treegrid-' + id + ' treegrid-parent-' + pid
|
||||
};
|
||||
};
|
||||
initTr.apply(that, [node, $.inArray(node, data), data, parentDom]);
|
||||
}
|
||||
};
|
||||
|
||||
// tr
|
||||
BootstrapTable.prototype.initRow = function (item, idx, data, parentDom) {
|
||||
var that = this;
|
||||
if (that.treeEnable) {
|
||||
// init root node
|
||||
if (that.options.onCheckRoot.apply(that, [item, data])) {
|
||||
if (item._level === undefined) {
|
||||
item._level = 0;
|
||||
}
|
||||
// jquery.treegrid.js
|
||||
that.options.rowStyle = function (item, idx) {
|
||||
var x = item[that.options.idField] ? item[that.options.idField] : 0;
|
||||
return {
|
||||
classes: 'treegrid-' + x
|
||||
};
|
||||
};
|
||||
initTr.apply(that, [item, idx, data, parentDom]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return _initRow.apply(that, Array.prototype.slice.apply(arguments));
|
||||
};
|
||||
}(jQuery);
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Flot",
|
||||
"version": "0.8.3",
|
||||
"main": "jquery.flot.js",
|
||||
"dependencies": {
|
||||
"jquery": ">= 1.2.6"
|
||||
},
|
||||
"homepage": "https://github.com/flot/flot",
|
||||
"_release": "0.8.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.8.3",
|
||||
"commit": "453b017cc5acfd75e252b93e8635f57f4196d45d"
|
||||
},
|
||||
"_source": "https://github.com/flot/flot.git",
|
||||
"_target": "^0.8.3",
|
||||
"_originalSource": "flot"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.8
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,98 @@
|
||||
## Contributing to Flot ##
|
||||
|
||||
We welcome all contributions, but following these guidelines results in less
|
||||
work for us, and a faster and better response.
|
||||
|
||||
### Issues ###
|
||||
|
||||
Issues are not a way to ask general questions about Flot. If you see unexpected
|
||||
behavior but are not 100% certain that it is a bug, please try posting to the
|
||||
[forum](http://groups.google.com/group/flot-graphs) first, and confirm that
|
||||
what you see is really a Flot problem before creating a new issue for it. When
|
||||
reporting a bug, please include a working demonstration of the problem, if
|
||||
possible, or at least a clear description of the options you're using and the
|
||||
environment (browser and version, jQuery version, other libraries) that you're
|
||||
running under.
|
||||
|
||||
If you have suggestions for new features, or changes to existing ones, we'd
|
||||
love to hear them! Please submit each suggestion as a separate new issue.
|
||||
|
||||
If you would like to work on an existing issue, please make sure it is not
|
||||
already assigned to someone else. If an issue is assigned to someone, that
|
||||
person has already started working on it. So, pick unassigned issues to prevent
|
||||
duplicated effort.
|
||||
|
||||
### Pull Requests ###
|
||||
|
||||
To make merging as easy as possible, please keep these rules in mind:
|
||||
|
||||
1. Submit new features or architectural changes to the *<version>-work*
|
||||
branch for the next major release. Submit bug fixes to the master branch.
|
||||
|
||||
2. Divide larger changes into a series of small, logical commits with
|
||||
descriptive messages.
|
||||
|
||||
3. Rebase, if necessary, before submitting your pull request, to reduce the
|
||||
work we need to do to merge it.
|
||||
|
||||
4. Format your code according to the style guidelines below.
|
||||
|
||||
### Flot Style Guidelines ###
|
||||
|
||||
Flot follows the [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines),
|
||||
with the following updates and exceptions:
|
||||
|
||||
#### Spacing ####
|
||||
|
||||
Use four-space indents, no tabs. Do not add horizontal space around parameter
|
||||
lists, loop definitions, or array/object indices. For example:
|
||||
|
||||
```js
|
||||
for ( var i = 0; i < data.length; i++ ) { // This block is wrong!
|
||||
if ( data[ i ] > 1 ) {
|
||||
data[ i ] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < data.length; i++) { // This block is correct!
|
||||
if (data[i] > 1) {
|
||||
data[i] = 2;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Comments ####
|
||||
|
||||
Use [jsDoc](http://usejsdoc.org) comments for all file and function headers.
|
||||
Use // for all inline and block comments, regardless of length.
|
||||
|
||||
All // comment blocks should have an empty line above *and* below them. For
|
||||
example:
|
||||
|
||||
```js
|
||||
var a = 5;
|
||||
|
||||
// We're going to loop here
|
||||
// TODO: Make this loop faster, better, stronger!
|
||||
|
||||
for (var x = 0; x < 10; x++) {}
|
||||
```
|
||||
|
||||
#### Wrapping ####
|
||||
|
||||
Block comments should be wrapped at 80 characters.
|
||||
|
||||
Code should attempt to wrap at 80 characters, but may run longer if wrapping
|
||||
would hurt readability more than having to scroll horizontally. This is a
|
||||
judgement call made on a situational basis.
|
||||
|
||||
Statements containing complex logic should not be wrapped arbitrarily if they
|
||||
do not exceed 80 characters. For example:
|
||||
|
||||
```js
|
||||
if (a == 1 && // This block is wrong!
|
||||
b == 2 &&
|
||||
c == 3) {}
|
||||
|
||||
if (a == 1 && b == 2 && c == 3) {} // This block is correct!
|
||||
```
|
@ -0,0 +1,75 @@
|
||||
## Frequently asked questions ##
|
||||
|
||||
#### How much data can Flot cope with? ####
|
||||
|
||||
Flot will happily draw everything you send to it so the answer
|
||||
depends on the browser. The excanvas emulation used for IE (built with
|
||||
VML) makes IE by far the slowest browser so be sure to test with that
|
||||
if IE users are in your target group (for large plots in IE, you can
|
||||
also check out Flashcanvas which may be faster).
|
||||
|
||||
1000 points is not a problem, but as soon as you start having more
|
||||
points than the pixel width, you should probably start thinking about
|
||||
downsampling/aggregation as this is near the resolution limit of the
|
||||
chart anyway. If you downsample server-side, you also save bandwidth.
|
||||
|
||||
|
||||
#### Flot isn't working when I'm using JSON data as source! ####
|
||||
|
||||
Actually, Flot loves JSON data, you just got the format wrong.
|
||||
Double check that you're not inputting strings instead of numbers,
|
||||
like [["0", "-2.13"], ["5", "4.3"]]. This is most common mistake, and
|
||||
the error might not show up immediately because Javascript can do some
|
||||
conversion automatically.
|
||||
|
||||
|
||||
#### Can I export the graph? ####
|
||||
|
||||
You can grab the image rendered by the canvas element used by Flot
|
||||
as a PNG or JPEG (remember to set a background). Note that it won't
|
||||
include anything not drawn in the canvas (such as the legend). And it
|
||||
doesn't work with excanvas which uses VML, but you could try
|
||||
Flashcanvas.
|
||||
|
||||
|
||||
#### The bars are all tiny in time mode? ####
|
||||
|
||||
It's not really possible to determine the bar width automatically.
|
||||
So you have to set the width with the barWidth option which is NOT in
|
||||
pixels, but in the units of the x axis (or the y axis for horizontal
|
||||
bars). For time mode that's milliseconds so the default value of 1
|
||||
makes the bars 1 millisecond wide.
|
||||
|
||||
|
||||
#### Can I use Flot with libraries like Mootools or Prototype? ####
|
||||
|
||||
Yes, Flot supports it out of the box and it's easy! Just use jQuery
|
||||
instead of $, e.g. call jQuery.plot instead of $.plot and use
|
||||
jQuery(something) instead of $(something). As a convenience, you can
|
||||
put in a DOM element for the graph placeholder where the examples and
|
||||
the API documentation are using jQuery objects.
|
||||
|
||||
Depending on how you include jQuery, you may have to add one line of
|
||||
code to prevent jQuery from overwriting functions from the other
|
||||
libraries, see the documentation in jQuery ("Using jQuery with other
|
||||
libraries") for details.
|
||||
|
||||
|
||||
#### Flot doesn't work with [insert name of Javascript UI framework]! ####
|
||||
|
||||
Flot is using standard HTML to make charts. If this is not working,
|
||||
it's probably because the framework you're using is doing something
|
||||
weird with the DOM or with the CSS that is interfering with Flot.
|
||||
|
||||
A common problem is that there's display:none on a container until the
|
||||
user does something. Many tab widgets work this way, and there's
|
||||
nothing wrong with it - you just can't call Flot inside a display:none
|
||||
container as explained in the README so you need to hold off the Flot
|
||||
call until the container is actually displayed (or use
|
||||
visibility:hidden instead of display:none or move the container
|
||||
off-screen).
|
||||
|
||||
If you find there's a specific thing we can do to Flot to help, feel
|
||||
free to submit a bug report. Otherwise, you're welcome to ask for help
|
||||
on the forum/mailing list, but please don't submit a bug report to
|
||||
Flot.
|
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
@ -0,0 +1,12 @@
|
||||
# Makefile for generating minified files
|
||||
|
||||
.PHONY: all
|
||||
|
||||
# we cheat and process all .js files instead of an exhaustive list
|
||||
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js)))
|
||||
|
||||
%.min.js: %.js
|
||||
yui-compressor $< -o $@
|
||||
|
||||
test:
|
||||
./node_modules/.bin/jshint *jquery.flot.js
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,143 @@
|
||||
## Writing plugins ##
|
||||
|
||||
All you need to do to make a new plugin is creating an init function
|
||||
and a set of options (if needed), stuffing it into an object and
|
||||
putting it in the $.plot.plugins array. For example:
|
||||
|
||||
```js
|
||||
function myCoolPluginInit(plot) {
|
||||
plot.coolstring = "Hello!";
|
||||
};
|
||||
|
||||
$.plot.plugins.push({ init: myCoolPluginInit, options: { ... } });
|
||||
|
||||
// if $.plot is called, it will return a plot object with the
|
||||
// attribute "coolstring"
|
||||
```
|
||||
|
||||
Now, given that the plugin might run in many different places, it's
|
||||
a good idea to avoid leaking names. The usual trick here is wrap the
|
||||
above lines in an anonymous function which is called immediately, like
|
||||
this: (function () { inner code ... })(). To make it even more robust
|
||||
in case $ is not bound to jQuery but some other Javascript library, we
|
||||
can write it as
|
||||
|
||||
```js
|
||||
(function ($) {
|
||||
// plugin definition
|
||||
// ...
|
||||
})(jQuery);
|
||||
```
|
||||
|
||||
There's a complete example below, but you should also check out the
|
||||
plugins bundled with Flot.
|
||||
|
||||
|
||||
## Complete example ##
|
||||
|
||||
Here is a simple debug plugin which alerts each of the series in the
|
||||
plot. It has a single option that control whether it is enabled and
|
||||
how much info to output:
|
||||
|
||||
```js
|
||||
(function ($) {
|
||||
function init(plot) {
|
||||
var debugLevel = 1;
|
||||
|
||||
function checkDebugEnabled(plot, options) {
|
||||
if (options.debug) {
|
||||
debugLevel = options.debug;
|
||||
plot.hooks.processDatapoints.push(alertSeries);
|
||||
}
|
||||
}
|
||||
|
||||
function alertSeries(plot, series, datapoints) {
|
||||
var msg = "series " + series.label;
|
||||
if (debugLevel > 1) {
|
||||
msg += " with " + series.data.length + " points";
|
||||
alert(msg);
|
||||
}
|
||||
}
|
||||
|
||||
plot.hooks.processOptions.push(checkDebugEnabled);
|
||||
}
|
||||
|
||||
var options = { debug: 0 };
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: "simpledebug",
|
||||
version: "0.1"
|
||||
});
|
||||
})(jQuery);
|
||||
```
|
||||
|
||||
We also define "name" and "version". It's not used by Flot, but might
|
||||
be helpful for other plugins in resolving dependencies.
|
||||
|
||||
Put the above in a file named "jquery.flot.debug.js", include it in an
|
||||
HTML page and then it can be used with:
|
||||
|
||||
```js
|
||||
$.plot($("#placeholder"), [...], { debug: 2 });
|
||||
```
|
||||
|
||||
This simple plugin illustrates a couple of points:
|
||||
|
||||
- It uses the anonymous function trick to avoid name pollution.
|
||||
- It can be enabled/disabled through an option.
|
||||
- Variables in the init function can be used to store plot-specific
|
||||
state between the hooks.
|
||||
|
||||
The two last points are important because there may be multiple plots
|
||||
on the same page, and you'd want to make sure they are not mixed up.
|
||||
|
||||
|
||||
## Shutting down a plugin ##
|
||||
|
||||
Each plot object has a shutdown hook which is run when plot.shutdown()
|
||||
is called. This usually mostly happens in case another plot is made on
|
||||
top of an existing one.
|
||||
|
||||
The purpose of the hook is to give you a chance to unbind any event
|
||||
handlers you've registered and remove any extra DOM things you've
|
||||
inserted.
|
||||
|
||||
The problem with event handlers is that you can have registered a
|
||||
handler which is run in some point in the future, e.g. with
|
||||
setTimeout(). Meanwhile, the plot may have been shutdown and removed,
|
||||
but because your event handler is still referencing it, it can't be
|
||||
garbage collected yet, and worse, if your handler eventually runs, it
|
||||
may overwrite stuff on a completely different plot.
|
||||
|
||||
|
||||
## Some hints on the options ##
|
||||
|
||||
Plugins should always support appropriate options to enable/disable
|
||||
them because the plugin user may have several plots on the same page
|
||||
where only one should use the plugin. In most cases it's probably a
|
||||
good idea if the plugin is turned off rather than on per default, just
|
||||
like most of the powerful features in Flot.
|
||||
|
||||
If the plugin needs options that are specific to each series, like the
|
||||
points or lines options in core Flot, you can put them in "series" in
|
||||
the options object, e.g.
|
||||
|
||||
```js
|
||||
var options = {
|
||||
series: {
|
||||
downsample: {
|
||||
algorithm: null,
|
||||
maxpoints: 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then they will be copied by Flot into each series, providing default
|
||||
values in case none are specified.
|
||||
|
||||
Think hard and long about naming the options. These names are going to
|
||||
be public API, and code is going to depend on them if the plugin is
|
||||
successful.
|
@ -0,0 +1,110 @@
|
||||
# Flot [](https://travis-ci.org/flot/flot)
|
||||
|
||||
## About ##
|
||||
|
||||
Flot is a Javascript plotting library for jQuery.
|
||||
Read more at the website: <http://www.flotcharts.org/>
|
||||
|
||||
Take a look at the the examples in examples/index.html; they should give a good
|
||||
impression of what Flot can do, and the source code of the examples is probably
|
||||
the fastest way to learn how to use Flot.
|
||||
|
||||
|
||||
## Installation ##
|
||||
|
||||
Just include the Javascript file after you've included jQuery.
|
||||
|
||||
Generally, all browsers that support the HTML5 canvas tag are
|
||||
supported.
|
||||
|
||||
For support for Internet Explorer < 9, you can use [Excanvas]
|
||||
[excanvas], a canvas emulator; this is used in the examples bundled
|
||||
with Flot. You just include the excanvas script like this:
|
||||
|
||||
```html
|
||||
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]-->
|
||||
```
|
||||
|
||||
If it's not working on your development IE 6.0, check that it has
|
||||
support for VML which Excanvas is relying on. It appears that some
|
||||
stripped down versions used for test environments on virtual machines
|
||||
lack the VML support.
|
||||
|
||||
You can also try using [Flashcanvas][flashcanvas], which uses Flash to
|
||||
do the emulation. Although Flash can be a bit slower to load than VML,
|
||||
if you've got a lot of points, the Flash version can be much faster
|
||||
overall. Flot contains some wrapper code for activating Excanvas which
|
||||
Flashcanvas is compatible with.
|
||||
|
||||
You need at least jQuery 1.2.6, but try at least 1.3.2 for interactive
|
||||
charts because of performance improvements in event handling.
|
||||
|
||||
|
||||
## Basic usage ##
|
||||
|
||||
Create a placeholder div to put the graph in:
|
||||
|
||||
```html
|
||||
<div id="placeholder"></div>
|
||||
```
|
||||
|
||||
You need to set the width and height of this div, otherwise the plot
|
||||
library doesn't know how to scale the graph. You can do it inline like
|
||||
this:
|
||||
|
||||
```html
|
||||
<div id="placeholder" style="width:600px;height:300px"></div>
|
||||
```
|
||||
|
||||
You can also do it with an external stylesheet. Make sure that the
|
||||
placeholder isn't within something with a display:none CSS property -
|
||||
in that case, Flot has trouble measuring label dimensions which
|
||||
results in garbled looks and might have trouble measuring the
|
||||
placeholder dimensions which is fatal (it'll throw an exception).
|
||||
|
||||
Then when the div is ready in the DOM, which is usually on document
|
||||
ready, run the plot function:
|
||||
|
||||
```js
|
||||
$.plot($("#placeholder"), data, options);
|
||||
```
|
||||
|
||||
Here, data is an array of data series and options is an object with
|
||||
settings if you want to customize the plot. Take a look at the
|
||||
examples for some ideas of what to put in or look at the
|
||||
[API reference](API.md). Here's a quick example that'll draw a line
|
||||
from (0, 0) to (1, 1):
|
||||
|
||||
```js
|
||||
$.plot($("#placeholder"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1 } });
|
||||
```
|
||||
|
||||
The plot function immediately draws the chart and then returns a plot
|
||||
object with a couple of methods.
|
||||
|
||||
|
||||
## What's with the name? ##
|
||||
|
||||
First: it's pronounced with a short o, like "plot". Not like "flawed".
|
||||
|
||||
So "Flot" rhymes with "plot".
|
||||
|
||||
And if you look up "flot" in a Danish-to-English dictionary, some of
|
||||
the words that come up are "good-looking", "attractive", "stylish",
|
||||
"smart", "impressive", "extravagant". One of the main goals with Flot
|
||||
is pretty looks.
|
||||
|
||||
|
||||
## Notes about the examples ##
|
||||
|
||||
In order to have a useful, functional example of time-series plots using time
|
||||
zones, date.js from [timezone-js][timezone-js] (released under the Apache 2.0
|
||||
license) and the [Olson][olson] time zone database (released to the public
|
||||
domain) have been included in the examples directory. They are used in
|
||||
examples/axes-time-zones/index.html.
|
||||
|
||||
|
||||
[excanvas]: http://code.google.com/p/explorercanvas/
|
||||
[flashcanvas]: http://code.google.com/p/flashcanvas/
|
||||
[timezone-js]: https://github.com/mde/timezone-js
|
||||
[olson]: http://ftp.iana.org/time-zones
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "Flot",
|
||||
"version": "0.8.3",
|
||||
"main": "jquery.flot.js",
|
||||
"dependencies": {
|
||||
"jquery": ">= 1.2.6"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Europe (EU27)",
|
||||
"data": [[1999, 3.0], [2000, 3.9]]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Europe (EU27)",
|
||||
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2]]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Europe (EU27)",
|
||||
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5]]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Europe (EU27)",
|
||||
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1]]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Europe (EU27)",
|
||||
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Europe (EU27)",
|
||||
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Japan",
|
||||
"data": [[1999, -0.1], [2000, 2.9], [2001, 0.2], [2002, 0.3], [2003, 1.4], [2004, 2.7], [2005, 1.9], [2006, 2.0], [2007, 2.3], [2008, -0.7]]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "USA",
|
||||
"data": [[1999, 4.4], [2000, 3.7], [2001, 0.8], [2002, 1.6], [2003, 2.5], [2004, 3.6], [2005, 2.9], [2006, 2.8], [2007, 2.0], [2008, 1.1]]
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue