Compare commits

...

8 Commits

Author SHA1 Message Date
kevin 85a1e420e8 南方医院接口完成 4 years ago
kevin e94b5d88fe 版本2 4 years ago
kevin c30240a01f 版本1 4 years ago
kevin 7f8d75cf9c Merge remote-tracking branch 'origin/nanfang_branch' into nanfang_branch
# Conflicts:
#	power-admin/src/main/java/com/manage/controller/FontController.java
#	power-admin/src/main/resources/config/jdbc.properties
4 years ago
kevin 583ffd0037 新增第三方免登陆授权接口 4 years ago
kevin f24f58ba7d 新增第三方免登陆授权接口 4 years ago
kevin e0a949b785 第三方免登录授权链接 4 years ago
kevin 97f089761d 第三方免登录授权链接 4 years ago

38
.gitignore vendored

@ -1,3 +1,35 @@
/target/
/.idea/
*.iml
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
*.iml
# 直接在这里添加即可,注意加上备注,好知道是忽略什么文件 #
##############################
## Folders ##
##############################
target
out
log
configLog
.idea
.project
**/.mvn
**/mvnw
**/mvnw.cmd

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="power-service" />
<module name="power-admin" />
<module name="power-dao" />
<module name="power-foundaton" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="emr_record" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/power-admin/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/power-admin/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/power-admin/src/main/webapp/权限系统版本说明.txt" charset="GBK" />
<file url="file://$PROJECT_DIR$/power-dao/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/power-dao/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/power-foundaton/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/power-service/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$/../../fs_hospital/EMR_Record_gm" />
<file type="web" url="file://$PROJECT_DIR$/power-admin" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/../../fs_hospital/EMR_Record_gm" vcs="Git" />
</component>
</project>

@ -13,10 +13,15 @@
Date: 08/07/2020 17:32:07
*/
DROP DATABASE IF EXISTS `Nanfang_hospital`;
CREATE DATABASE `Nanfang_hospital` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
USE `Nanfang_hospital`;
-- ----------------------------
-- Table structure for power_dept
-- ----------------------------

@ -51,6 +51,7 @@
<poi.version>3.9</poi.version>
<sigar.version>1.6.3</sigar.version>
<base64.version>138</base64.version>
<cxf.version>3.1.8</cxf.version>
</properties>
<!-- maven依赖 -->
@ -217,6 +218,66 @@
<version>${base64.version}</version>
<scope>compile</scope>
</dependency>
<!--以下是王和坤添加的jar包--> <!--webService-->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.1.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.1.6</version>
</dependency>
<!-- 进行jaxes 服务开发 -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.0.1</version>
</dependency>
<!-- 内置jetty web服务器 -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.0.1</version>
</dependency>
<!-- xml转换工具 -->
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.8.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>

@ -75,6 +75,15 @@
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
@ -93,9 +102,25 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jaxen/jaxen -->
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.75</version>
</dependency>
<!-- WebService服务 -->
@ -107,6 +132,23 @@
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.cxf</groupId>-->
<!-- <artifactId>cxf-rt-transports-http</artifactId>-->
<!-- <version>3.1.8</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.cxf</groupId>-->
<!-- <artifactId>cxf-rt-frontend-jaxws</artifactId>-->
<!-- <version>3.1.8</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>xerces</groupId>-->
<!-- <artifactId>xercesImpl</artifactId>-->
<!-- <version>2.11.0</version>-->
<!-- </dependency>-->
<!--commoms-->
<dependency>
<groupId>org.apache.commons</groupId>
@ -127,6 +169,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.6</version>
</dependency>
</dependencies>
<build>
<finalName>power</finalName>

@ -0,0 +1,20 @@
package com.manage.config;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
@Component //或者继承implements ApplicationRunner 实现run()方法
public class MyHandel {
@PostConstruct
public void loadDic() {
System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
}
//在spring容器关闭时释放
@PreDestroy
public void destroy() {
//系统运行结束
}
}

@ -1,34 +0,0 @@
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,48 @@
package com.manage.config;
import com.manage.interfaces.webservice.PowerWebService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* @author by CLP
* @Classname BeanConfig
* @Description
* @Date 2020/9/8 15:28
*/
@Component
public class WebServiceCxf implements InitializingBean, ApplicationContextAware {
private static Map<String, PowerWebService> queryServiceImplMap = new HashMap<>();
private ApplicationContext applicationContext;
public static PowerWebService createQueryService(String type) {
PowerWebService powerWebService = queryServiceImplMap.get(type);
if (powerWebService == null) {
return queryServiceImplMap.get("PowerServiceImpl");
}
return powerWebService;
}
@Override
public void afterPropertiesSet() throws Exception {
Map<String, PowerWebService> beanMap = applicationContext.getBeansOfType(PowerWebService.class);
//遍历该接口的所有实现将其放入map中
for (PowerWebService serviceImpl : beanMap.values()) {
queryServiceImplMap.put(serviceImpl.getClass().getSimpleName(), serviceImpl);
}
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
}

@ -1,11 +1,14 @@
package com.manage.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.manage.config.WebServiceCxf;
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.interfaces.webservice.PowerWebService;
import com.manage.interfaces.webservice.impl.PowerWebServiceImpl;
import com.manage.service.*;
import com.manage.service.cache.Cache;
import com.manage.service.cache.CacheManager;
@ -16,16 +19,23 @@ import com.manage.util.ExceptionPrintUtil;
import com.manage.util.Msg;
import com.manage.vo.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.endpoint.Client;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
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.util.CollectionUtils;
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.bind.annotation.*;
import java.io.StringReader;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @ProjectName:
@ -63,6 +73,10 @@ public class FontController {
@Autowired
private Power_DeptService power_deptService;
public static Class getUserClass(Object root) {
return null;
}
/**
* 2.1
* @ProjectName: getRolePowerTreeBySysFlag
@ -363,6 +377,252 @@ public class FontController {
return Msg.success().add("list",list);
}
// public static void main(String[] args) throws UnsupportedEncodingException {
// String xml="<Request><SourceSystem>*******</SourceSystem><TargetSystem>医院信息平台</TargetSystem><username>sj</username><password>1C821B22D0402F317E40D93213C66843</password></Request>";
// XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8")));
// String username = xmlUtils.getElement("username");
// String password = xmlUtils.getElement("password");
// System.out.println(username);
// System.out.println(password);
// System.out.println(ResultUtils.success().asXML());
// }
/**
* 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 = "getTokenForHis",method = RequestMethod.POST)
@ResponseBody
public Msg getTokenForHis(@RequestParam("username") String userName,@RequestParam("password")String password) throws Exception{
if(StringUtils.isBlank(userName)){
return Msg.fail("用户名不能为空");
}
if(StringUtils.isBlank(password)){
return Msg.fail("密码不能为空");
}
//2.根据userName查询我们的用户表是否存在
Power_UserVo userVo = new Power_UserVo();
// 判断数据库中是否有此用户,如果没有则插入数据库
String result = linkHisLogin(userName, password);
if(StringUtils.isBlank(result)){
return Msg.fail("调用第三方认证失败");
}
List<Power_User> userList = userMapper.checkUserName(userName);
if (CollectionUtils.isEmpty(userList)) {
//2.1不存在往用户表新增这条用户
userVo.setUserName(userName);
// userVo.setUserPwd(Base64.encode(MD5.KL("1C821B22D0402F317E40D93213C66843")));
userVo.setUserPwd(Base64.encode(MD5.KL("123456")));
//TODO name从应答的xml解析
String name = analysis(result,"Name");
userVo.setName(name);
userVo.setRoleId(1);
userVo.setDeptId("3");
userVo.setEffective(1);
userVo.setCreater("his");
SimpleDateFormat fmt= new SimpleDateFormat("yyyy-MM-dd");
userVo.setCreateDate(fmt.format(new Date()));
//插入00
userMapper.insert(userVo);
}
String token = setToken(userVo);
return Msg.success().add("token",token);
}
/**
* xmlMap xml"." XML
*
* @param xml
* @param map
* @return
*/
private Map<String, String> parseXml2Map(String xml, Map<String, String> map) {
try {
SAXReader reader = new SAXReader();
Document doc = reader.read(new StringReader(xml));
Element root = doc.getRootElement();
String path = "";
if (map.containsKey(root.getName().trim())) {
path = map.get(root.getName().trim());
map.remove(root.getName().trim());
}
for (Iterator i = root.elementIterator(); i.hasNext();) {
Element element = (Element) i.next();
if (element.isTextOnly()) {
if (path.length() > 0) {
map.put(path + element.getName().trim(), element.getTextTrim());
} else {
map.put(element.getName().trim(), element.getTextTrim());
}
} else {
map.put(element.getName().trim(), path+ element.getName().trim() + ".");
parseXml2Map(element.asXML(), map);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return map;
}
/**
* resultxmlname
* @param result
* @param name
* @return
*/
private String analysis(String result, String name) {
String nameValue = "";
Map<String,String> map = new HashMap<>();
Map<String, String> valueMap = parseXml2Map(result, map);
nameValue = valueMap.get("Name");
return nameValue;
}
private String linkHisLogin(String userName, String password) {
//创建连接工厂
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
//创建客户端
Object[] objects = new Object[0];
Client client = dcf.createClient("http://192.168.128.170/csp/hsb/DHC.Published.PUB0025.BS.PUB0025.CLS?WSDL=1");
try {
// //医院给的webservice地址
// String url = "http://192.168.128.170/csp/hsb/DHC.Published.PUB0025.BS.PUB0025.CLS?WSDL=1";
// client = dcf.createClient(url);
//动态调用getInfosByUserId方法
//获取请求参数xml字符串
String xmlStr = getXml(userName,password);
objects = client.invoke("HIPManagerInfo","S0110", xmlStr);
//应答信息
String result = objects[0].toString();
System.out.println(result);
//新用户存到数据库
if (result.contains("成功")) {
return result;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if(null != client) {
client.destroy();
}
}
return null;
}
private String getXml(String userName, String password) {
// 1、创建document对象
Document document = DocumentHelper.createDocument();
// 2、创建根节点rss
Element requestElement = document.addElement("Request");
// Element patInfo = Requst.addElement("PatInfo");
// patInfo.addElement("VUID").setText("12412");
requestElement.addElement("SourceSystem").setText("厦门嘉时");
requestElement.addElement("TargetSystem").setText("医院信息平台");
requestElement.addElement("username").setText(userName);
requestElement.addElement("password").setText(password);
OutputFormat format = OutputFormat.createPrettyPrint();
// 设置编码格式
format.setEncoding("UTF-8");
String xml = document.asXML();
System.out.println(xml);
// String res = service.outHOSREG(xml);
// TBasicWebServiceService serviceService=new TBasicWebServiceService();
// TBasicWebService service = serviceService.getTBasicWebServicePort();
// String res = service.outHOSCAN(xml);
// System.out.println(res);
return document.asXML();
}
/**
* getInfosByUserId
* @param
* @return
*/
@RestController
public class TestController{
@Autowired
private PowerWebServiceImpl powerWebService;
@Autowired
private WebServiceCxf webServiceCxf;
@GetMapping("/call")
public String call(String id) {
PowerWebService queryService = WebServiceCxf.createQueryService(id);
System.out.println(queryService.toString());
// return queryService.getInfosByUserId("token","sj");
String token = CacheManager.getCacheByUserId(id);
return queryService.getInfosByUserId(token, id);
}
}
private String setToken(Power_UserVo userVo){
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 (Power_Menu powerMenu : list) {
User_Dept_Menu deptMenu = new User_Dept_Menu();
String menuUrl = powerMenu.getMenuUrl();
if (StringUtils.isNotBlank(menuUrl)) {
BeanUtils.copyProperties(powerMenu, deptMenu);
deptMenu.setMethodParent(powerMenu.getParentId());
menuList.add(deptMenu);
}
if (StringUtils.isNotBlank(powerMenu.getMethod())) {
menus.add(powerMenu.getMenuUrl());
}
}
}
userVo.setMenuList(menuList);
userVo.setMenus(menus);
//设置科室
StringBuilder powerDepts = new StringBuilder();
List<Power_Dept> powerDeptList = power_deptService.selectByPrimaryKeys(userVo.getDeptId());
for(int j = 0;j < powerDeptList.size();j++){
if(j<powerDeptList.size()-1){
powerDepts.append(powerDeptList.get(j).getDeptName()).append(",");
}else{
powerDepts.append(powerDeptList.get(j).getDeptName());
}
}
userVo.setRemark(powerDepts.toString());
//移除缓存
CacheManager.removeCacheByObject(userVo);
CacheManager.putCache(date,new Cache(date,userVo,TOKEN_EXPIRE_TIME));
return token;
}
/**
* 2.10
* @ProjectName: getToken
@ -587,4 +847,4 @@ public class FontController {
e.printStackTrace();
}
}
}
}

@ -0,0 +1,53 @@
package com.manage.controller;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.CXFBusFactory;
import org.apache.cxf.endpoint.EndpointImplFactory;
import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
import org.apache.cxf.jaxws.support.JaxWsEndpointImplFactory;
import java.util.List;
/**
* @ProjectName:
* @Description:
* @Param
* @Return
* @Author:
* @CreateDate: 2019/9/11 16:15
* @UpdateUser:
* @UpdateDate: 2019/9/11 16:15
* @UpdateRemark:
* @Version: 1.0
*/
public class JAXDynamicClientFactory extends DynamicClientFactory {
protected JAXDynamicClientFactory(Bus bus) {
super(bus);
}
@Override
protected EndpointImplFactory getEndpointImplFactory() {
return JaxWsEndpointImplFactory.getSingleton();
}
@Override
protected boolean allowWrapperOps() {
return true;
}
public static JAXDynamicClientFactory newInstance() {
Bus bus = CXFBusFactory.getThreadDefaultBus();
return new JAXDynamicClientFactory(bus);
}
@Override
public boolean compileJavaSrc(String classPath, List srcList, String dest) {
org.apache.cxf.common.util.Compiler javaCompiler
= new org.apache.cxf.common.util.Compiler();
javaCompiler.setEncoding("UTF-8");
javaCompiler.setClassPath(classPath);
javaCompiler.setOutputDir(dest);
javaCompiler.setTarget("1.8");
return javaCompiler.compileFiles(srcList);
}
}

@ -3,6 +3,7 @@ package com.manage.interfaces.webservice;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
@WebService
@ -11,6 +12,9 @@ public interface PowerWebService {
@WebMethod()
String getInfosByUserId(@WebParam(name = "token") String token,String sysId);
@WebMethod
String tempTest();
}

@ -1,6 +1,7 @@
package com.manage.interfaces.webservice.impl;
import com.alibaba.fastjson.JSON;
import com.manage.controller.JAXDynamicClientFactory;
import com.manage.dao.Power_MenuMapper;
import com.manage.encrypt.Base64;
import com.manage.encrypt.MD5;
@ -11,10 +12,13 @@ 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.util.XmlUtil;
import com.manage.vo.AuthUserVO;
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.apache.cxf.endpoint.Client;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -67,11 +71,19 @@ public class PowerWebServiceImpl implements PowerWebService {
return JSON.toJSONString(userWebServiceVo);
}
@Override
public String tempTest() {
return "aaaa~~~~~~~~~~~~~~~~~~~~~~~";
}
// @Override
// public String helloWebService(String name) {
// return "<Response> <ResultCode>0</ResultCode> <ResultCount>成功</ResultCount> <Id>270</Id> <Name>苏*瑾</Name> <Code>SJ</Code> <Sex></Sex> < Age ></Age> <CareType>副主任医师</CareType> <Group>住院医生</Group> <Loc>HXYWZZYXKBF-呼吸与危重症医学科病房</Loc> <Tel></Tel> </Response> ";
// }
private List<Power_Menu> getPowerMenuMethods(Power_User powerUser, String sysId){
// 根据用户ID以及系统Id查出所有的用户菜单
List<Power_Menu> powerUserMenus = powerMenuMapper.selectUserMenuByUserIdAndDictId(powerUser.getUserId(), Integer.parseInt(sysId));

@ -0,0 +1,211 @@
//package com.docus.bgts.utils;
//
//import com.alibaba.fastjson.JSON;
//import org.apache.http.HttpEntity;
//import org.apache.http.NameValuePair;
//import org.apache.http.client.ClientProtocolException;
//import org.apache.http.client.entity.UrlEncodedFormEntity;
//import org.apache.http.client.methods.*;
//import org.apache.http.client.utils.URIBuilder;
//import org.apache.http.entity.ContentType;
//import org.apache.http.entity.StringEntity;
//import org.apache.http.impl.client.CloseableHttpClient;
//import org.apache.http.impl.client.HttpClients;
//import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
//import org.apache.http.message.BasicNameValuePair;
//import org.apache.http.util.EntityUtils;
//
//import java.io.IOException;
//import java.io.UnsupportedEncodingException;
//import java.net.URISyntaxException;
//import java.util.ArrayList;
//import java.util.Map;
//
//public class HttpUtils {
// private static PoolingHttpClientConnectionManager cm;
// private static String EMPTY_STR = "";
// private static String UTF_8 = "UTF-8";
//
// private static void init() {
// if (cm == null) {
// cm = new PoolingHttpClientConnectionManager();
// cm.setMaxTotal(50);// 整个连接池最大连接数
// cm.setDefaultMaxPerRoute(5);// 每路由最大连接数默认值是2
// }
// }
//
// /**
// * 通过连接池获取HttpClient
// *
// * @return
// */
// private static CloseableHttpClient getHttpClient() {
// init();
// return HttpClients.custom().setConnectionManager(cm).build();
// }
// /**
// * @param url
// * @return
// */
// public static String get(String url) {
// HttpGet httpGet = new HttpGet(url);
// return getResult(httpGet);
// }
// /**
// * @param url、params
// * @return
// */
// public static String get(String url, Map<String, String > params) throws URISyntaxException {
// URIBuilder ub = new URIBuilder();
// ub.setPath(url);
//
// ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
// ub.setParameters(pairs);
//
// HttpGet httpGet = new HttpGet(ub.build());
// return getResult(httpGet);
// }
// /**
// * @param url、headers、params
// * @return
// */
// public static String get(String url, Map<String, Object> headers, Map<String, String> params)
// throws URISyntaxException {
// URIBuilder ub = new URIBuilder();
// ub.setPath(url);
//
// if (params != null) {
// ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
// ub.setParameters(pairs);
// }
//
// HttpGet httpGet = new HttpGet(ub.build());
// for (Map.Entry<String, Object> param : headers.entrySet()) {
// httpGet.addHeader(param.getKey(), String.valueOf(param.getValue()));
// }
// return getResult(httpGet);
// }
// /**
// * @param url
// * @return
// */
// public static String post(String url) {
// HttpPost httpPost = new HttpPost(url);
// return getResult(httpPost);
// }
// /**
// * @param url、params
// * @return
// */
// public static String post(String url, Map<String, String> params) throws UnsupportedEncodingException {
// HttpPost httpPost = new HttpPost(url);
// httpPost.setEntity(new UrlEncodedFormEntity(covertParams2NVPS(params), "utf-8"));//设置表单提交编码
//
//// httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_FORM_URLENCODED));
// return getResult(httpPost);
// }
//
// public static String post(String url, Object params, Map<String, Object> head) throws UnsupportedEncodingException {
// HttpPost httpPost = new HttpPost(url);
// System.out.println(params);
// httpPost.setEntity(new StringEntity(params.toString()));//设置表单提交编码
// if (params != null) {
// for (Map.Entry<String, Object> param : head.entrySet()) {
// httpPost.addHeader(param.getKey(), String.valueOf(param.getValue()));
// }
// }
//// httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_FORM_URLENCODED));
// return getResult(httpPost);
// }
//
// private static ArrayList<NameValuePair> covertParams2NVPS(Map<String, String> params) {
// ArrayList<NameValuePair> pairs = new ArrayList<NameValuePair>();
// for (Map.Entry<String, String> param : params.entrySet()) {
// if (param.getValue() != null) {
// pairs.add(new BasicNameValuePair(param.getKey(), param.getValue()));
// }
// }
//
// return pairs;
// }
// /**
// * @param url、headers、params
// * @return
// */
// public static String post(String url, Map<String, Object> headers, Map<String, Object> params)
// throws UnsupportedEncodingException {
// HttpPost httpPost = new HttpPost(url);
// System.out.println(params);
// if (params != null) {
// for (Map.Entry<String, Object> param : headers.entrySet()) {
// httpPost.addHeader(param.getKey(), String.valueOf(param.getValue()));
// }
// }
//
// httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_JSON));
//
// return getResult(httpPost);
// }
//
// /**
// * 处理Http请求
// *
// * @param request
// * @return
// */
// private static String getResult(HttpRequestBase request) {
// // CloseableHttpClient httpClient = HttpClients.createDefault();
// CloseableHttpClient httpClient = getHttpClient();
// try {
// CloseableHttpResponse response = httpClient.execute(request);
// // response.getStatusLine().getStatusCode();
// HttpEntity entity = response.getEntity();
// if (entity != null) {
// // long len = entity.getContentLength();// -1 表示长度未知
// String result = EntityUtils.toString(entity, UTF_8);
// response.close();
// // httpClient.close();
// return result;
// }
// } catch (ClientProtocolException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// } finally {
//
// }
//
// return EMPTY_STR;
// }
//
// /**
// * 处理Http请求
// *
// * @param requestBuilder
// * @return
// */
// private static String getResult(RequestBuilder requestBuilder) {
// // CloseableHttpClient httpClient = HttpClients.createDefault();
// CloseableHttpClient httpClient = getHttpClient();
// try {
// CloseableHttpResponse response = httpClient.execute(requestBuilder.build());
// // response.getStatusLine().getStatusCode();
// HttpEntity entity = response.getEntity();
// if (entity != null) {
// // long len = entity.getContentLength();// -1 表示长度未知
// String result = EntityUtils.toString(entity, UTF_8);
// response.close();
// // httpClient.close();
// return result;
// }
// } catch (ClientProtocolException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// } finally {
//
// }
//
// return EMPTY_STR;
// }
//}

@ -0,0 +1,44 @@
package com.docus.bgts.utils;
import java.io.*;
/**
* json
*/
public class JsonUtils {
/**
* json
* @param fileNamejson
* @return
*/
public static String readJsonFile(String fileName) {
String jsonStr = "";
Reader reader=null;
FileReader fileReader=null;
try {
File jsonFile = new File(fileName);
fileReader = new FileReader(jsonFile);
reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8");
int ch = 0;
StringBuffer sb = new StringBuffer();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
fileReader.close();
reader.close();
jsonStr = sb.toString();
return jsonStr;
} catch (IOException e) {
e.printStackTrace();
return null;
}finally {
try {
reader.close();
fileReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

@ -0,0 +1,73 @@
package com.manage.utils;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
/**
*
*/
public class ResultUtils {
/**
* document
* @param response
* @return
*/
public static Element getElement(Document response){
Element element = response.getRootElement();
return element;
}
/**
*
* @return
*/
public static Document success(){
// 1、创建document对象
Document document= DocumentHelper.createDocument();
//2.创建根节点
Element response=document.addElement("Response");
// 3、生成子节点及子节点内容
response.addElement("ResultCode").setText("0");
response.addElement("ResultCount").setText("成功");
return document;
}
/**
*
* @return
*/
public static String fail(){
// 1、创建document对象
Document document= DocumentHelper.createDocument();
//2.创建根节点
Element response=document.addElement("Response");
// 3、生成子节点及子节点内容
response.addElement("ResultCode").setText("1");
response.addElement("ResultCount").setText("失败");
// //赋值
// resCode.setText(String.valueOf(Codes.ERROR.getCode()));
// retCon.setText(Codes.ERROR.getMessage());
return document.asXML();
}
// /**
// * 失败返回
// * @return
// */
// public static String fail(String message){
// // 1、创建document对象
// Document document= DocumentHelper.createDocument();
// //2.创建根节点
// Element response=document.addElement(Codes.RESPONSE.getMessage());
// // 3、生成子节点及子节点内容
// Element RetInfo = response.addElement(Codes.RET_INFO.getMessage());
// //4.生成代码和描述节点
// Element resCode = RetInfo.addElement(Codes.RET_CODE.getMessage());
// Element retCon = RetInfo.addElement(Codes.RET_CON.getMessage());
// //赋值
// resCode.setText(String.valueOf(Codes.ERROR.getCode()));
// retCon.setText(StringUtils.isNotBlank(message)?message: Codes.ERROR.getMessage());
// return document.asXML();
// }
}

@ -0,0 +1,134 @@
package com.manage.utils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import java.io.InputStream;
public class XmlUtils {
//定义解析器和文档对象
private SAXReader saxReader;
private Document document;
public XmlUtils(String path) {
//获取解析器
saxReader = new SAXReader();
try {
//获取文档对象
document = saxReader.read(path);
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public XmlUtils(InputStream path) {
//获取解析器
saxReader = new SAXReader();
try {
//获取文档对象
document = saxReader.read(path);
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
*
*
* @return
*/
public String getElement(String name) {
//获取根节点
Element root = document.getRootElement();
// Object directory = FileUtils.getJsonByName(Codes.DIRECTORY.getMessage());
// Element current = root;
// if (directory == null) {
// throw new RuntimeException("没有定义目录结构");
// }
// List<String> directoryArr = (List<String>) directory;
// for (String dire : directoryArr) {
// current = current.element(dire);
// }
return root.element(name) == null ? "" : root.element(name).getText();
}
// /**
// * 根据路径动态获取节点
// *
// * @return
// */
// public Element getElement(List<String> directory) {
// //获取根节点
// Element root = document.getRootElement();
//
// Element current = root;
// List<String> directoryArr = directory;
// for (String dire : directoryArr) {
// current = current.element(dire);
// }
// if (current == null) {
// throw new RuntimeException("未找到对应节点");
// }
// return current;
// }
//
// /**
// * 返回存在的根节点
// */
// public List<Element> getJsonByName() {
// //获取目录结构
// String path = FileUtils.currentPath();
// //解析json映射文件
// String json = com.docus.bgts.utils.JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage());
// Map jsonMap = JSON.parseObject(json, Map.class);
// //判断是否多条
// List<String> basicArr = (List<String>) jsonMap.get("doubleBasic");
// List<String> directory = (List<String>) jsonMap.get("basicDirectory");
// List<Element> elements = null;
// Element root = this.getElement(directory);
// for (String basic : basicArr) {
// elements = root.elements(basic);
// if (elements != null && elements.size() > 0) {
// break;
// }
// }
// if (elements == null || elements.size() == 0) {
// //只有一条
// List<String> rootDirectory = (List<String>) jsonMap.get("directory");
// root = this.getElement(rootDirectory);
// elements = new ArrayList<>();
// elements.add(root);
// }
// return elements;
// }
//
// /**
// * 根据节点名称获取内容
// *
// * @param name 节点名称
// * @return 节点内容
// */
// public String getElementText(String name) {
// //定位根节点
// Element root = document.getRootElement();
// //根据名称定位节点
// Element msg = root.element(Codes.MSG.getMessage());
// if (msg == null) {
// throw new RuntimeException("没有" + Codes.MSG.getMessage() + "节点");
// }
//// Element patInfo = msg.element(Codes.PAT_INFO.getMessage());
//// if(patInfo==null){
//// throw new RuntimeException("没有"+Codes.PAT_INFO.getMessage()+"节点");
//// }
// Element element = msg.element(name);
// if (element == null) {
// return null;
// }
// //返回节点内容
// return element.getText();
// }
}

@ -34,6 +34,8 @@
<property name="initialSize" value="10"/> <!-- 初始化连接池内的数据库连接-->
</bean>
<bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus" destroy-method="shutdown"/>
<!-- ====================== 配置和MyBatis的整合 ======================== -->

@ -9,8 +9,8 @@ TOKEN_EXPIRE_TIME = 3600000
##################################################服务器ip##########################################################
#通用服务器IP与通用服务器端口
SERVER_IP = 192.168.1.3
SERVER_PORT = 8081
SERVER_IP = localhost
SERVER_PORT = 8080
#power权限系统ip
POWER_IP = ${SERVER_IP}
@ -25,7 +25,7 @@ EMRMEDICALRECORD_PORT = 8082
#病案管理系统ip
EMRRECORD_IP = ${SERVER_IP}
#病案管理系统端口
EMRRECORD_PORT = 8083
EMRRECORD_PORT = 8081
#病案复印预约ip
EMRAPPLYCOPY_IP = ${SERVER_IP}

@ -1,7 +1,9 @@
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc\:mysql\://192.168.1.3\:3306/qfpower?useUnicode\=true&characterEncoding\=utf-8
jdbc.url=jdbc:mysql://localhost/nanfang_hospital?useUnicode\=true&characterEncoding\=utf-8
jdbc.username=root
jdbc.password=docus702
jdbc.password=mamba1998
#hibernate config
hibernate.dialect = org.hibernate.dialect.MySQLDialect

@ -12,7 +12,8 @@
<typeAliases>
<package name="com.manage.entity"/>
</typeAliases>
<plugins>
<!-- com.github.pagehelper为PageHelper类所在包名 -->
<plugin interceptor="com.github.pagehelper.PageInterceptor">

@ -19,6 +19,12 @@
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<!-- xml转换工具 -->
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<version>2.7.1</version>
</dependency>
</dependencies>
<build>

@ -0,0 +1,32 @@
package com.manage.dao;
public class InvokeParam {
private String url;
private String method;
private String xml;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getXml() {
return xml;
}
public void setXml(String xml) {
this.xml = xml;
}
}

@ -0,0 +1,58 @@
package com.manage.vo;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@Root(name = "Request")
public class AuthUserVO {
private String SourceSystem;
@Element(required = false)
private String TargetSystem;
private String username;
private String password;
public String getSourceSystem() {
return SourceSystem;
}
public void setSourceSystem(String sourceSystem) {
SourceSystem = sourceSystem;
}
public String getTargetSystem() {
return TargetSystem;
}
public void setTargetSystem(String targetSystem) {
TargetSystem = targetSystem;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "AuthUserVO{" +
"SourceSystem='" + SourceSystem + '\'' +
", TargetSystem='" + TargetSystem + '\'' +
", username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}

@ -0,0 +1,48 @@
package com.manage.vo;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
@XmlRootElement(name = "Request")
public class token implements Serializable {
private String username;
private String password;
public token() {
super();
}
public token(String username, String password) {
super();
this.username = username;
this.password = password;
}
public String getUsername() {
return username;
}
@XmlElement
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
@XmlElement
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "token{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}

@ -2,7 +2,7 @@ jdbc.driver=com.mysql.jdbc.Driver
#jdbc.url=jdbc\:mysql\://localhost\:3306/power?useUnicode\=true&characterEncoding\=utf-8
jdbc.url=jdbc\:mysql\://120.27.212.36\:3306/power?useUnicode\=true&characterEncoding\=utf-8
jdbc.username=root
jdbc.password=docus702
jdbc.password=mamba1998
#执行:右键 Run As ---->Maven build ---->Goals:mybatis-generator:generate
#输出目录

@ -51,6 +51,12 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<!-- xml转换工具 -->
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<version>2.7.1</version>
</dependency>
<!--系统使用率导包开始-->
<!--<dependency> &lt;!&ndash;工具类 小数格式化 可以改为其他&ndash;&gt;
<groupId>cn.hutool</groupId>

@ -0,0 +1,27 @@
package com.manage.util;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import javax.xml.bind.JAXBException;
public class XmlUtil {
/**
* xml
*/
public static <T> T xmlToEntity(Class<T> clazz, String str) {
try {
Serializer serializer = new Persister();
T entity = serializer.read(clazz, str);
return entity;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

@ -0,0 +1,13 @@
package com.manage.service;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public interface WeatherServiceInter {
@WebMethod
public String getWeatherByCityname(String name);
}

@ -1,6 +1,7 @@
package com.manage.service.cache;
import com.manage.vo.Power_UserVo;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
@ -154,4 +155,29 @@ public class CacheManager {
}
} catch (Exception ex) {}
}
/**
* idtoken
* @param userId
* @return
*/
public static String getCacheByUserId(Object userId) {
if (StringUtils.isBlank(String.valueOf(userId)))
return "";
String token = "";
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();
// 通过用户id获取缓存
if (userId.equals(o.getUserId())) {
token = (String) entry.getKey();
break;
}
}
} catch (Exception ex) {}
return token;
}
}

@ -0,0 +1,11 @@
package com.manage.service.ipml;
import com.manage.service.WeatherServiceInter;
public class WeatherServiceInterImpl implements WeatherServiceInter {
@Override
public String getWeatherByCityname(String name) {
System.out.println(name+"");
return name+"";
}
}
Loading…
Cancel
Save