| | |
| | | <version>3.8.5</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <!-- <packaging>war</packaging>--> |
| | | <packaging>jar</packaging> |
| | | <artifactId>ruoyi-admin</artifactId> |
| | | <artifactId>smartor-admin</artifactId> |
| | | |
| | | <description> |
| | | webæå¡å
¥å£ |
| | |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- spring-boot-devtools --> |
| | | <!-- spring-boot-devtools --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | |
| | | <!-- Mysql驱å¨å
--> |
| | | <!-- Mysql驱å¨å
--> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | |
| | | <artifactId>json</artifactId> |
| | | <version>20210307</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> |
| | | <dependency> |
| | | <groupId>org.codehaus.woodstox</groupId> |
| | | <artifactId>stax2-api</artifactId> |
| | | <version>3.1.1</version> |
| | | </dependency> |
| | | |
| | | <!-- https://mvnrepository.com/artifact/ca.uhn.hapi/hapi-base --> |
| | | <dependency> |
| | | <groupId>ca.uhn.hapi</groupId> |
| | | <artifactId>hapi-base</artifactId> |
| | | <version>2.3</version> |
| | | </dependency> |
| | | <!-- https://mvnrepository.com/artifact/ca.uhn.hapi/hapi-structures-v24 --> |
| | | <dependency> |
| | | <groupId>ca.uhn.hapi</groupId> |
| | | <artifactId>hapi-structures-v24</artifactId> |
| | | <version>2.3</version> |
| | | </dependency> |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | <warName>${project.artifactId}</warName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugin> |
| | | </plugins> |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | |
| | | package com.ruoyi; |
| | | |
| | | import com.ruoyi.web.controller.socket.SocketCommunication; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | |
| | | " | | \\ `' /| `-' / \n" + |
| | | " | | \\ / \\ / \n" + |
| | | " ''-' `'-' `-..-' "); |
| | | //å¼å¯SOCKET |
| | | new SocketCommunication().socketCommunication(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.read; |
| | | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.smartor.service.IBaseTagService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ£è
ä¿¡æ¯å¯¼å
¥ï¼æ¥æ¶è伿¶æ¯æ¨éï¼ |
| | | * |
| | | * @author ls |
| | | * @date 2023-08-03 |
| | | */ |
| | | @Slf4j |
| | | @Api(description = "æ£è
ä¿¡æ¯å¯¼å
¥ï¼æ¥æ¶è伿¶æ¯æ¨éï¼") |
| | | @RestController |
| | | @RequestMapping("/patient/read") |
| | | public class PatientInfoImportController extends BaseController { |
| | | @Autowired |
| | | private IBaseTagService baseTagService; |
| | | |
| | | /** |
| | | * æ£è
åºæ¬ä¿¡æ¯ |
| | | */ |
| | | @ApiOperation("æ£è
åºæ¬ä¿¡æ¯") |
| | | @PostMapping("/patientInfo") |
| | | public void patientBaseInfo(@RequestParam String pateintInfo) { |
| | | log.info("æ£è
åºæ¬ä¿¡æ¯ : {}", pateintInfo); |
| | | String[] split = pateintInfo.split("\\|"); |
| | | List<String> stringList = Arrays.asList(split); |
| | | System.out.println(stringList); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.socket; |
| | | |
| | | import ca.uhn.hl7v2.DefaultHapiContext; |
| | | import ca.uhn.hl7v2.HapiContext; |
| | | import ca.uhn.hl7v2.model.v24.message.ACK; |
| | | import ca.uhn.hl7v2.parser.Parser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.service.impl.RemoteDataSaveServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.io.*; |
| | | import java.net.ServerSocket; |
| | | import java.net.Socket; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Instant; |
| | | import java.time.ZoneId; |
| | | import java.time.ZonedDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.Executor; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | @RestController |
| | | @Slf4j |
| | | public class SocketCommunication { |
| | | |
| | | |
| | | public String socketCommunication() { |
| | | try { |
| | | // å建 ServerSocket å®ä¾ï¼çå¬ 8080 ç«¯å£ |
| | | ServerSocket serverSocket = new ServerSocket(8999); |
| | | //åºå®çº¿ç¨æ± æ¥æ¥æ¶å¤ç |
| | | Executor executor = Executors.newFixedThreadPool(3); |
| | | // çå¾
客æ·ç«¯è¿æ¥ |
| | | while (true) { |
| | | Socket socket = serverSocket.accept(); |
| | | // new Thread(new MyRuns(socket)).start(); |
| | | executor.execute(new MyRuns(socket)); |
| | | } |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return "åçå¼å¸¸ï¼" + e.getMessage(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | class MyRuns implements Runnable { |
| | | |
| | | |
| | | Socket socket; |
| | | BufferedReader reader; |
| | | PrintWriter writer = null; |
| | | // BufferedWriter writer; |
| | | |
| | | public MyRuns(Socket socket) { |
| | | super(); |
| | | this.socket = socket; |
| | | } |
| | | |
| | | public void run() { |
| | | Map<String, List> map = new HashMap<>(); |
| | | |
| | | try { |
| | | reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"));//读å客æ·ç«¯æ¶æ¯ |
| | | // writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())); |
| | | writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()), true);//å客æ·ç«¯åæ¶æ¯ |
| | | |
| | | //è·å第ä¸è¡æ°æ® |
| | | String oneLine = reader.readLine(); |
| | | // å建HapiContextå®ä¾ |
| | | HapiContext context = new DefaultHapiContext(); |
| | | // å建Parserå®ä¾ |
| | | Parser parser = context.getPipeParser(); |
| | | |
| | | // è§£æHL7æ¶æ¯ |
| | | List<String> list = dataExplain(oneLine); |
| | | map.put(list.get(0).trim(), list); |
| | | |
| | | //è·åè¿åæ°æ® |
| | | String messageControlID = list.get(9); |
| | | String timeOfAnEvent = list.get(6); |
| | | String senderApp = list.get(2); |
| | | String senderFac = list.get(3); |
| | | |
| | | String dataType = list.get(8); |
| | | if (StringUtils.isNotEmpty(dataType)) { |
| | | int endIndex = dataType.lastIndexOf("^"); |
| | | dataType = dataType.substring(0, endIndex); |
| | | int endIndex2 = dataType.lastIndexOf("^"); |
| | | dataType = dataType.substring(endIndex2); |
| | | } |
| | | |
| | | //设置æ¶é´æ³ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYYMMddHHmmss"); |
| | | String timestamp = simpleDateFormat.format(new Date()); |
| | | |
| | | //è¿åååºï¼ååºæ°æ®è¿è¡ç»è£
ï¼ |
| | | ACK ack = new ACK(); |
| | | ack.initQuickstart("ACK", "2.4", "P"); |
| | | // 设置MSH段çåæ®µ |
| | | ack.getMSH().getSendingApplication().getNamespaceID().setValue("HIS"); |
| | | ack.getMSH().getSendingFacility().getNamespaceID().setValue(senderFac); |
| | | ack.getMSH().getReceivingApplication().getNamespaceID().setValue(senderApp); |
| | | ack.getMSH().getReceivingFacility().getNamespaceID().setValue(senderFac); |
| | | ack.getMSH().getDateTimeOfMessage().getTimeOfAnEvent().setValue(timeOfAnEvent); |
| | | ack.getMSH().getMessageType().getMessageType().setValue("ACK"); |
| | | ack.getMSH().getMessageType().getTriggerEvent().setValue("ACK"); |
| | | ack.getMSH().getMessageControlID().setValue(timestamp); |
| | | ack.getMSH().getProcessingID().getProcessingID().setValue("P"); |
| | | ack.getMSH().getVersionID().getVersionID().setValue("2.4"); |
| | | // 设置MSA段çåæ®µ |
| | | ack.getMSA().getAcknowledgementCode().setValue("AA"); |
| | | ack.getMSA().getMessageControlID().setValue(messageControlID); |
| | | ack.getMSA().getTextMessage().setValue(""); |
| | | |
| | | // å°ACKæ¶æ¯è½¬æ¢ä¸ºå符串 |
| | | String responseString = parser.encode(ack); |
| | | //è·å两个ACKçä½ç½® |
| | | int ack1 = responseString.indexOf("ACK", 0); |
| | | int i1 = responseString.lastIndexOf("^ACK"); |
| | | //ç»ä¸¤ä¸ªACKä¹é´å 䏿°æ®ç±»å |
| | | responseString = responseString.substring(0, ack1 + 3) + dataType + responseString.substring(i1); |
| | | |
| | | //å ä¸å¼å§ç¬¦åç»æç¬¦ |
| | | char startSymbol = 0x0B; // å¼å§ç¬¦ï¼0x0Bï¼ |
| | | char endSymbol = 0x1C; // ç»æç¬¦ï¼0x1Cï¼ |
| | | String backData = String.valueOf(startSymbol) + responseString + String.valueOf(endSymbol); |
| | | writer.println(backData); |
| | | |
| | | //å¤çä¼ æ¥çæ°æ® |
| | | String lineString = null; |
| | | String dataInfo = ""; |
| | | dataInfo += oneLine + "\r\n"; |
| | | while ((lineString = reader.readLine()) != null) { |
| | | // 对è·åçæ°æ®ï¼è¿è¡æ¼æ¥ |
| | | List<String> list2 = dataExplain(lineString); |
| | | if (!CollectionUtils.isEmpty(list2)) { |
| | | //keyæå¯è½éå¤ï¼å¯¼è´æ°æ®è¢«è¦çï¼æä»¥ï¼å¾æ°æ®åºä¿åæ°æ®çæ¶åï¼ç¨stringBuilderéçæ°æ® |
| | | map.put(list2.get(0).trim(), list2); |
| | | } |
| | | dataInfo += lineString + "\r\n"; |
| | | |
| | | } |
| | | //廿æåä¸ä¸ªæ¢è¡ |
| | | int i = dataInfo.lastIndexOf("\r\n"); |
| | | dataInfo = dataInfo.substring(0, i); |
| | | |
| | | //æå°ä¸ä¸æ¶å°æ°æ®æ¶é´ |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); |
| | | String date = simpleDateFormat1.format(new Date()); |
| | | System.out.println(date + " æ¶å°æ°æ®æ¶é´,å
容 : " + dataInfo); |
| | | |
| | | RemoteDataSaveServiceImpl remoteDataSaveService = new RemoteDataSaveServiceImpl(); |
| | | remoteDataSaveService.dealData(map, dataInfo); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | if (reader != null) { |
| | | reader.close(); |
| | | } |
| | | if (writer != null) { |
| | | writer.close(); |
| | | } |
| | | if (socket != null) { |
| | | socket.close(); |
| | | } |
| | | } catch (Exception e2) { |
| | | e2.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | private List<String> dataExplain(String data) { |
| | | String[] segments = data.split("\r"); |
| | | ArrayList<String> arrayList = new ArrayList(); |
| | | |
| | | // Process each segment |
| | | for (String segment : segments) { |
| | | // æ ¹æ® '|'è¿è¡æªå |
| | | String[] fields = segment.split("\\|"); |
| | | |
| | | // éåæ°ç» |
| | | for (String field : fields) { |
| | | arrayList.add(field); |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.core.config; |
| | | |
| | | import org.apache.catalina.connector.Connector; |
| | | import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class TomcatConfig { |
| | | @Bean |
| | | public TomcatServletWebServerFactory webServerFactory() { |
| | | TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); |
| | | factory.addConnectorCustomizers((Connector connector) -> { |
| | | connector.setProperty("relaxedPathChars", "\"#<>[\\]^`{|}/"); |
| | | connector.setProperty("relaxedQueryChars", "\"#<>[\\]^`{|}/"); |
| | | }); |
| | | return factory; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.webservice; |
| | | |
| | | import javax.jws.WebMethod; |
| | | import javax.jws.WebParam; |
| | | import javax.jws.WebService; |
| | | |
| | | @WebService(name = "API_ESB_Service", // æ´é²æå¡åç§° |
| | | targetNamespace = "http://webservice.web.ruoyi.com"// å½å空é´,ä¸è¬æ¯æ¥å£çå
åååº |
| | | ) |
| | | public interface PateintBaseService { |
| | | |
| | | @WebMethod(action = "Run") |
| | | public String Run(@WebParam(name = "MessageVersion") String MessageVersion,@WebParam(name = "MessageType") String MessageType,@WebParam(name = "Message") String Message); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.webservice; |
| | | |
| | | |
| | | import com.ruoyi.web.webservice.impl.PateintBaseServiceImpl; |
| | | import org.apache.cxf.Bus; |
| | | import org.apache.cxf.bus.spring.SpringBus; |
| | | import org.apache.cxf.jaxws.EndpointImpl; |
| | | import org.apache.cxf.transport.servlet.CXFServlet; |
| | | import org.springframework.boot.web.servlet.ServletRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.xml.ws.Endpoint; |
| | | |
| | | @Configuration |
| | | public class PstientWSConfig { |
| | | @Bean |
| | | public ServletRegistrationBean disServlet() { |
| | | |
| | | |
| | | ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new CXFServlet(), "/API_ESB_Service"); |
| | | return servletRegistrationBean; |
| | | } |
| | | |
| | | @Bean(name = Bus.DEFAULT_BUS_ID) |
| | | public SpringBus springBus() { |
| | | |
| | | |
| | | return new SpringBus(); |
| | | } |
| | | @Bean |
| | | public Endpoint endpoint() { |
| | | |
| | | |
| | | EndpointImpl endpoint = new EndpointImpl(springBus(),new PateintBaseServiceImpl()); |
| | | endpoint.publish(""); |
| | | return endpoint; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.webservice.impl; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.web.webservice.PateintBaseService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.jws.WebService; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @WebService(serviceName = "API_ESB_Service", // 䏿¥å£ä¸æå®çnameä¸è´ |
| | | targetNamespace = "http://webservice.web.ruoyi.com", // 䏿¥å£ä¸çå½å空é´ä¸è´,ä¸è¬æ¯æ¥å£çå
åå |
| | | endpointInterface = "com.ruoyi.web.webservice.PateintBaseService"// æ¥å£å°å |
| | | ) |
| | | @Component |
| | | @Slf4j |
| | | public class PateintBaseServiceImpl implements PateintBaseService { |
| | | @Override |
| | | public String Run(String MessageVersion, String MessageType, String Message) { |
| | | log.info("æ£è
ä¿¡æ¯: {}", Message); |
| | | log.info("æ£è
ä¿¡æ¯: {}", Message); |
| | | log.info("æ£è
ä¿¡æ¯: {}", Message); |
| | | if (StringUtils.isNotEmpty(Message)) { |
| | | String[] split = Message.split("\\|"); |
| | | List<String> stringList = Arrays.asList(split); |
| | | System.out.println(stringList); |
| | | } |
| | | return Message; |
| | | } |
| | | } |
| | |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://116.62.18.175:6002/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: hxsoft |
| | | password: Hxerp2000 |
| | | url: jdbc:mysql://127.0.0.1:3306/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | # url: jdbc:mysql://116.62.18.175:6002/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | # username: hxsoft |
| | | # password: Hxerp2000 |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 8080 |
| | | port: 8181 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | host: 116.62.18.175 |
| | | host: 127.0.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | # port: 6379 |
| | | # # å°å |
| | | # host: 116.62.18.175 |
| | | # # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6020 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | public enum FollowUpEnum { |
| | | |
| | | HZGH("ADT^A04", "æ£è
æå·"), |
| | | WCJZ("REF^I12", "宿æ¥è¯"), |
| | | CFSQ("OMP^O09[NW~PH~IP]", "夿¹ç³è¯·"), |
| | | CFSFQR("OMP^O09[OK^SC]", "夿¹æ¶è´¹ç¡®è®¤"), |
| | | CFTFQR("OMP^O09[OK^DC]", "夿¹é费确认"), |
| | | HZZDXXXG("ADT^A08", "æ£è
è¯æä¿¡æ¯ä¿®æ¹"), |
| | | JCBGMJZ("ORU^R01[UX~CM]", "æ£æ¥æ¥å(鍿¥è¯ä¸å¡)"), |
| | | |
| | | KS("MFN^Z2B", "ç§å®¤"), |
| | | BQ("MFN^Z2C", "ç
åº"), |
| | | XZZGXX("PMU^B01", "æ°å¢è工信æ¯"), |
| | | XGZGXX("PMU^B02", "ä¿®æ¹è工信æ¯"), |
| | | JBZDXX("MFN^Z4A", "ç¾ç
åå
¸ä¿¡æ¯"), |
| | | SSZDXX("MFN^Z8A", "ææ¯åå
¸ä¿¡æ¯"), |
| | | YPZDXX("MFN^Z3C", "è¯ååå
¸ä¿¡æ¯"), |
| | | HZJBXXXG("ADT^A31", "æ£è
åºæ¬ä¿¡æ¯ä¿®æ¹"), |
| | | |
| | | HZRY("ADT^A01", "æ£è
å
¥é¢"), |
| | | HZQXRY("ADT^A11", "æ£è
åæ¶å
¥é¢"), |
| | | HZRK("ADT^A10", "æ£è
å
¥ç§"), |
| | | HZQXRK("ADT^A32", "æ£è
åæ¶å
¥ç§"), |
| | | HZYCY("ADT^A16", "æ£è
é¢åºé¢"), |
| | | QXYCY("ADT^A25", "åæ¶é¢åºé¢"), |
| | | YZSQ("OMP^O09[NW~IP]", "å»å±ç³è¯·"), |
| | | YZZF("OMP^O09[CA~CA]", "å»å±ä½åº"), |
| | | YZTZ("OMP^O09[DC~DC]", "å»å±åæ¢"), |
| | | ZDXXXG("ADT^A08", "è¯æä¿¡æ¯ä¿®æ¹"), |
| | | JCBG("ORU^R01[UX~CM]", "æ£æ¥æ¥å"), |
| | | JCSJ("ORU^R01", "æ£æ¥æ°æ®"), |
| | | JYBG("OUL^R21", "æ£éªæ¥å"), |
| | | CFXZSQ("OMP^O09", "夿¹æ°å¢ç³è¯·"), |
| | | SHDJ("SIU^S21", "æ¯åç»è®°"); |
| | | |
| | | |
| | | private String code; |
| | | private String desc; |
| | | |
| | | FollowUpEnum(String code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static String getDescByCode(String code) { |
| | | FollowUpEnum[] organEnums = values(); |
| | | for (int i = 0; i < organEnums.length; i++) { |
| | | FollowUpEnum organEnum = organEnums[i]; |
| | | if (organEnum.getCode().equals(code)) { |
| | | return organEnum.getDesc(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public void setDesc(String desc) { |
| | | this.desc = desc; |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * spring securityé
ç½® |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) |
| | | public class SecurityConfig extends WebSecurityConfigurerAdapter |
| | | { |
| | | public class SecurityConfig extends WebSecurityConfigurerAdapter { |
| | | /** |
| | | * èªå®ä¹ç¨æ·è®¤è¯é»è¾ |
| | | */ |
| | | @Autowired |
| | | private UserDetailsService userDetailsService; |
| | | |
| | | |
| | | /** |
| | | * 认è¯å¤±è´¥å¤çç±» |
| | | */ |
| | |
| | | */ |
| | | @Autowired |
| | | private JwtAuthenticationTokenFilter authenticationTokenFilter; |
| | | |
| | | |
| | | /** |
| | | * è·¨åè¿æ»¤å¨ |
| | | */ |
| | |
| | | */ |
| | | @Bean |
| | | @Override |
| | | public AuthenticationManager authenticationManagerBean() throws Exception |
| | | { |
| | | public AuthenticationManager authenticationManagerBean() throws Exception { |
| | | return super.authenticationManagerBean(); |
| | | } |
| | | |
| | |
| | | * authenticated | ç¨æ·ç»å½åå¯è®¿é® |
| | | */ |
| | | @Override |
| | | protected void configure(HttpSecurity httpSecurity) throws Exception |
| | | { |
| | | protected void configure(HttpSecurity httpSecurity) throws Exception { |
| | | // 注解æ è®°å
许å¿å访é®çurl |
| | | ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry = httpSecurity.authorizeRequests(); |
| | | permitAllUrl.getUrls().forEach(url -> registry.antMatchers(url).permitAll()); |
| | |
| | | // è¿æ»¤è¯·æ± |
| | | .authorizeRequests() |
| | | // 对äºç»å½login 注åregister éªè¯ç captchaImage å
许å¿åè®¿é® |
| | | .antMatchers("/login", "/register", "/captchaImage","/qrcode/generateStaticHtml","/qrcode/getQRcode","/qrcode/getFormDate","/chat","/system/file/admin/uploadFile").permitAll() |
| | | .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo","/socket","/API_ESB_Service","/API_ESB_Service/Run").permitAll() |
| | | // éæèµæºï¼å¯å¿åè®¿é® |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| | | .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | | // é¤ä¸é¢å¤çææè¯·æ±å
¨é¨éè¦é´æè®¤è¯ |
| | | .anyRequest().authenticated() |
| | | .and() |
| | | .headers().frameOptions().disable(); |
| | | .anyRequest().authenticated().and().headers().frameOptions().disable(); |
| | | // æ·»å Logout filter |
| | | httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler); |
| | | // æ·»å JWT filter |
| | |
| | | * 强æ£ååå¸å å¯å®ç° |
| | | */ |
| | | @Bean |
| | | public BCryptPasswordEncoder bCryptPasswordEncoder() |
| | | { |
| | | public BCryptPasswordEncoder bCryptPasswordEncoder() { |
| | | return new BCryptPasswordEncoder(); |
| | | } |
| | | |
| | |
| | | * èº«ä»½è®¤è¯æ¥å£ |
| | | */ |
| | | @Override |
| | | protected void configure(AuthenticationManagerBuilder auth) throws Exception |
| | | { |
| | | protected void configure(AuthenticationManagerBuilder auth) throws Exception { |
| | | auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); |
| | | } |
| | | } |
| | |
| | | DingTalkReqVo dingTalkReqVo = new DingTalkReqVo(); |
| | | //设置åéå
容 |
| | | dingTalkReqVo.setContents(null); |
| | | dingTalkReqVo.setDeptId(reportReqVo.getDealDeptID()); |
| | | dingTalkReqVo.setDeptId(Long.valueOf(reportReqVo.getDealDeptID())); |
| | | dingTalkReqVo.setUserId(reportReqVo.getDealPersionDingNO()); |
| | | aBoolean = dingTalkService.sendNotification(dingTalkReqVo); |
| | | } |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | /** |
| | | * ééæ¶æ¯åé |
| | |
| | | * åéå
容 |
| | | */ |
| | | @ApiModelProperty(value = "åéå
容") |
| | | private List<String> contents; |
| | | private List<ConcurrentHashMap<String, String>> contents; |
| | | |
| | | /** |
| | | * ç¨æ·ééå· |
| | | */ |
| | | @ApiModelProperty(value = "ç¨æ·ééå·") |
| | | private String userId; |
| | | @ApiModelProperty(value = "ç¨æ·ææºå·") |
| | | private String number; |
| | | |
| | | /** |
| | | * é¨é¨ID |
| | | */ |
| | | @ApiModelProperty(value = "é¨é¨ID") |
| | | private String deptId; |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * åéæ¶æ¯çæ é¢ |
| | | */ |
| | | @ApiModelProperty(value = "åéæ¶æ¯çæ é¢") |
| | | private String title; |
| | | |
| | | /** |
| | | * 跳转url |
| | | */ |
| | | @ApiModelProperty(value = "跳转url") |
| | | private String url; |
| | | /** |
| | | * 跳转url |
| | | */ |
| | | @ApiModelProperty(value = "跳转url") |
| | | private String userId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹ååæ°æ®å¯¹è±¡ service_third_data |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-10-10 |
| | | */ |
| | | @Data |
| | | @ApiModel("ç¬¬ä¸æ¹ååæ°æ®") |
| | | public class ServiceThirdData { |
| | | |
| | | /** |
| | | * $column.columnComment |
| | | */ |
| | | @ApiModelProperty("$column.columnComment") |
| | | //æ°æ®åºèªå¢æ¹æ@TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ°æ®ç±»å |
| | | */ |
| | | @ApiModelProperty("æ°æ®ç±»å") |
| | | @Excel(name = "æ°æ®ç±»å") |
| | | private String dataType; |
| | | |
| | | /** |
| | | * æ°æ®ç±»åè§£é |
| | | */ |
| | | @ApiModelProperty("æ°æ®ç±»åè§£é") |
| | | @Excel(name = "æ°æ®ç±»åè§£é") |
| | | private String dataTypeExplain; |
| | | |
| | | /** |
| | | * æ°æ®åå¨ |
| | | */ |
| | | @ApiModelProperty("æ°æ®åå¨") |
| | | @Excel(name = "æ°æ®åå¨") |
| | | private String dataInfo; |
| | | |
| | | /** |
| | | * åå |
| | | */ |
| | | @ApiModelProperty("åå") |
| | | @Excel(name = "åå") |
| | | private String factory; |
| | | |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * æ°æ®æ¯å¦å¤ç1ï¼0æªå¤çï¼1å·²å¤ç |
| | | */ |
| | | @ApiModelProperty("æ°æ®æ¯å¦å¤ç1ï¼0æªå¤çï¼1å·²å¤ç") |
| | | @Excel(name = "æ°æ®æ¯å¦å¤ç1ï¼0æªå¤çï¼1å·²å¤ç") |
| | | private Integer isDeal; |
| | | |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.mapper; |
| | | |
| | | |
| | | import com.smartor.domain.ServiceThirdData; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹ååæ°æ®Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-10-10 |
| | | */ |
| | | @Mapper |
| | | public interface ServiceThirdDataMapper { |
| | | /** |
| | | * æ¥è¯¢ç¬¬ä¸æ¹ååæ°æ®å表 |
| | | * |
| | | * @param serviceThirdData ç¬¬ä¸æ¹ååæ°æ® |
| | | * @return ç¬¬ä¸æ¹ååæ°æ®éå |
| | | */ |
| | | public List<ServiceThirdData> selectServiceThirdDataList(ServiceThirdData serviceThirdData); |
| | | |
| | | /** |
| | | * æ°å¢çä¿¡åæ° |
| | | * |
| | | * @param serviceThirdData çä¿¡åæ° |
| | | * @return ç»æ |
| | | */ |
| | | public int insertThirdData(ServiceThirdData serviceThirdData); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.smartor.domain.ServiceThirdData; |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹ååæ°æ®Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-10-10 |
| | | */ |
| | | public interface IServiceThirdDataService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¬ä¸æ¹ååæ°æ®å表 |
| | | * |
| | | * @param serviceThirdData ç¬¬ä¸æ¹ååæ°æ® |
| | | * @return ç¬¬ä¸æ¹ååæ°æ®éå |
| | | */ |
| | | public List<ServiceThirdData> queryList(ServiceThirdData serviceThirdData); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * è¿ç¨æ°æ®ä¿åæ¥å£ |
| | | * |
| | | * @author ls |
| | | * @date 2023-10-10 |
| | | */ |
| | | public interface RemoteDataSaveService { |
| | | public void dealData(Map<String, List> map, String dataInfo); |
| | | |
| | | /** |
| | | * æ£è
åºæ¬ä¿¡æ¯ |
| | | * |
| | | * @param map |
| | | * @return æ£è
åºæ¬ä¿¡æ¯ |
| | | */ |
| | | public Boolean patientInfo(Map<String, List> map); |
| | | |
| | | /** |
| | | * æ£è
åºæ¬ä¿¡æ¯ä¿®æ¹ |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | public Boolean patientInfoEdit(Map<String, List> map); |
| | | |
| | | /** |
| | | * æ£è
å
¥é¢ |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | public Boolean patientHospitalized(Map<String, List> map); |
| | | |
| | | |
| | | } |
| | |
| | | import com.dingtalk.api.request.OapiGettokenRequest; |
| | | import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request; |
| | | import com.dingtalk.api.request.OapiUserListidRequest; |
| | | import com.dingtalk.api.request.OapiV2UserGetbymobileRequest; |
| | | import com.dingtalk.api.response.OapiGettokenResponse; |
| | | import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; |
| | | import com.dingtalk.api.response.OapiUserListidResponse; |
| | | import com.dingtalk.api.response.OapiV2UserGetbymobileResponse; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.DingTalkReqVo; |
| | | import com.smartor.service.DingTalkService; |
| | | import com.smartor.service.IntelligenceCenterService; |
| | | import com.taobao.api.ApiException; |
| | | import lombok.extern.log4j.Log4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | /** |
| | | * æºè½ä¸å¿ |
| | | * |
| | |
| | | |
| | | @Override |
| | | public Boolean sendNotification(DingTalkReqVo dingTalkReqVo) { |
| | | String body = null; |
| | | List<String> userIdlist = new ArrayList(); |
| | | Boolean result = false; |
| | | log.info("åééééç¥"); |
| | | |
| | | String accessToken = null; |
| | | try { |
| | | accessToken = getAccessToken(); |
| | | } catch (ApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | DingTalkClient client3 = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/user/listid"); |
| | | if (StringUtils.isNotEmpty(dingTalkReqVo.getNumber())) { |
| | | DingTalkClient clientT = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getbymobile"); |
| | | OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest(); |
| | | req.setMobile(dingTalkReqVo.getNumber()); |
| | | OapiV2UserGetbymobileResponse rsp = null; |
| | | try { |
| | | rsp = clientT.execute(req, accessToken); |
| | | body = rsp.getBody(); |
| | | String jsonObject = JSONObject.parseObject(body).getJSONObject("result").get("userid").toString(); |
| | | userIdlist.add(jsonObject); |
| | | |
| | | OapiUserListidRequest request2 = new OapiUserListidRequest(); |
| | | request2.setDeptId(675909059L); // 设置è¦è·åçé¨é¨ IDï¼è¿éä»¥æ ¹é¨é¨ä¸ºä¾ |
| | | // 设置é¨é¨ IDï¼å¦æè·åææåå·¥ææºå·ï¼å¯ä»¥è®¾ç½®ä¸ºæ ¹é¨é¨ç ID |
| | | OapiUserListidResponse response2 = null; |
| | | try { |
| | | response2 = client3.execute(request2, accessToken); |
| | | } catch (ApiException e) { |
| | | e.printStackTrace(); |
| | | } catch (ApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } else { |
| | | DingTalkClient client3 = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/user/listid"); |
| | | |
| | | OapiUserListidRequest request2 = new OapiUserListidRequest(); |
| | | request2.setDeptId(dingTalkReqVo.getDeptId()); // 设置è¦è·åçé¨é¨ IDï¼è¿éä»¥æ ¹é¨é¨ä¸ºä¾675909059L |
| | | // 设置é¨é¨ IDï¼å¦æè·åææåå·¥ææºå·ï¼å¯ä»¥è®¾ç½®ä¸ºæ ¹é¨é¨ç ID |
| | | OapiUserListidResponse response2 = null; |
| | | try { |
| | | response2 = client3.execute(request2, accessToken); |
| | | } catch (ApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | body = response2.getBody(); |
| | | // è§£æä¸ºJSONObject |
| | | JSONObject jsonObject = JSONObject.parseObject(body); |
| | | // æååºJSONArray |
| | | JSONArray jsonArray = new JSONArray(jsonObject.getJSONObject("result").getJSONArray("userid_list")); |
| | | // å°JSONArray转为Listå表 |
| | | String str = JSONObject.toJSONString(jsonArray); |
| | | userIdlist = JSONObject.parseObject(str, List.class); |
| | | } |
| | | String body = response2.getBody(); |
| | | // è§£æä¸ºJSONObject |
| | | JSONObject jsonObject = JSONObject.parseObject(body); |
| | | // æååºJSONArray |
| | | JSONArray jsonArray = new JSONArray(jsonObject.getJSONObject("result").getJSONArray("userid_list")); |
| | | // å°JSONArray转为Listå表 |
| | | String str = JSONObject.toJSONString(jsonArray); |
| | | List<String> list = JSONObject.parseObject(str, List.class); |
| | | |
| | | |
| | | //useridæ°ç» |
| | | for (String urid : list) { |
| | | for (String urid : userIdlist) { |
| | | DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2"); |
| | | OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request(); |
| | | request.setUseridList(urid); |
| | | request.setAgentId(1779052814L); |
| | | request.setToAllUser(false); |
| | | |
| | | List<String> contents = dingTalkReqVo.getContents(); |
| | | //åéå
容å¤ç |
| | | List<ConcurrentHashMap<String, String>> contents = dingTalkReqVo.getContents(); |
| | | ArrayList<OapiMessageCorpconversationAsyncsendV2Request.Form> objects = new ArrayList<>(); |
| | | for (int i = 0; i < contents.size(); i++) { |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form formSeverityDesc = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | formSeverityDesc.setKey("é®é¢" + i); |
| | | formSeverityDesc.setValue(contents.get(i).toString()); |
| | | objects.add(formSeverityDesc); |
| | | ConcurrentHashMap<String, String> map = contents.get(i); |
| | | for (Map.Entry<String, String> entry : map.entrySet()) { |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form formSeverityDesc = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | formSeverityDesc.setKey(entry.getKey()); |
| | | formSeverityDesc.setValue(entry.getValue()); |
| | | objects.add(formSeverityDesc); |
| | | } |
| | | } |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); |
| | | msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA()); |
| | | msg.getOa().setMessageUrl("https://www.baidu.com"); |
| | | msg.getOa().setPcMessageUrl("https://www.baidu.com"); |
| | | msg.getOa().setMessageUrl(dingTalkReqVo.getUrl()); |
| | | msg.getOa().setPcMessageUrl(dingTalkReqVo.getUrl()); |
| | | msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head()); |
| | | msg.getOa().getHead().setText("å¾
åäºå®"); |
| | | // msg.getOa().getHead().setText("ä½ å¨è¯´å¥å¢ç»é¡¶æ¿èå¤ºé¿æ¯èè¬é¿æ¯èè¬"); |
| | | msg.getOa().getHead().setBgcolor("00409eff"); |
| | | msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body()); |
| | | msg.getOa().getBody().setTitle("å°æ¬ç " + "AAA" + "(项ç®ç»ç)"); |
| | | msg.getOa().getBody().setContent("å¾
审æ¹:" + "123" + "æ¡"); |
| | | msg.getOa().getBody().setTitle(dingTalkReqVo.getTitle()); |
| | | // msg.getOa().getBody().setContent("å¾
å¤ç:" + "123" + "æ¡"); |
| | | |
| | | msg.getOa().getBody().setForm(objects); |
| | | msg.setMsgtype("oa"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.github.pagehelper.util.StringUtil; |
| | | import com.ruoyi.common.enums.FollowUpEnum; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.smartor.domain.ServiceThirdData; |
| | | import com.smartor.mapper.ServiceThirdDataMapper; |
| | | import com.smartor.service.RemoteDataSaveService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.applet.AppletContext; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ã请填ååè½åç§°ãServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-05-25 |
| | | */ |
| | | @Service |
| | | public class RemoteDataSaveServiceImpl implements RemoteDataSaveService { |
| | | |
| | | /** |
| | | * æ°æ®å¤ç |
| | | * |
| | | * @param map |
| | | */ |
| | | @Override |
| | | public void dealData(Map<String, List> map, String dataInfo) { |
| | | if (CollectionUtils.isEmpty(map)) { |
| | | return; |
| | | } |
| | | |
| | | //æ ¹æ®ææ¡£å¾ç¥ï¼ç¬¬8个ï¼ä»0å¼å§ï¼å°±æ¯æ°æ®ç±»å |
| | | List msh = map.get("MSH"); |
| | | String result = msh.get(8).toString(); |
| | | |
| | | //è·åå°æåä¸ä¸ªâ ^ âçä½ç½®,æ¹ä¾¿ä¸é¢æªåæ°æ®ç±»åï¼å°±æ¯åè¿æ¥çå
容æ¯å¥ï¼ |
| | | int endIndex = result.lastIndexOf("^"); |
| | | String dataType = result.substring(0, endIndex); |
| | | System.out.println("dataType : " + dataType); |
| | | ServiceThirdData serviceThirdData = new ServiceThirdData(); |
| | | serviceThirdData.setDataType(dataType); |
| | | serviceThirdData.setDataTypeExplain(FollowUpEnum.getDescByCode(dataType)); |
| | | //æ¤å¤ä¸è½ç¨mapçæ°æ®ï¼å 为æçæ°æ®çKEYå¯è½æ¯ä¸æ ·çï¼æä»¥ç¨stringéçæ°æ® |
| | | serviceThirdData.setDataInfo(dataInfo); |
| | | serviceThirdData.setFactory("èä¼"); |
| | | serviceThirdData.setIsDeal(0); |
| | | serviceThirdData.setCreateTime(new Date()); |
| | | |
| | | //æ¤å¤å¼ä¸å°spingä¸çmapper,åªè½éè¿ä¸ä¸æï¼å»è·åmapper对象 |
| | | ServiceThirdDataMapper serviceThirdDataMapper = SpringUtils.getBean(ServiceThirdDataMapper.class); |
| | | try { |
| | | int i = serviceThirdDataMapper.insertThirdData(serviceThirdData); |
| | | } catch (Exception e) { |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); |
| | | String date = simpleDateFormat1.format(new Date()); |
| | | System.out.println(date + " æ¥éæ¶é´ï¼æªæå
¥çæ°æ® : " + dataInfo); |
| | | e.getMessage(); |
| | | } |
| | | |
| | | |
| | | // //æ ¹æ®æ°æ®ç±»åï¼å»è°ç¨ç¸åºçæ¹æ³è¿è¡æ°æ®ä¿å(è¿ä¸åå
ä¸åäºï¼åé¢åå) |
| | | // switch (dataType) { |
| | | // case "ADT^A31": |
| | | // //æ£è
åºæ¬ä¿¡æ¯ |
| | | // patientInfo(map); |
| | | // break; |
| | | // case "ADT^A08": |
| | | // //æ£è
è¯æä¿¡æ¯ä¿®æ¹/ |
| | | // patientInfoEdit(map); |
| | | // case "ADT^A01": |
| | | // //æ£è
å
¥é¢ |
| | | // patientHospitalized(map); |
| | | // break; |
| | | // } |
| | | } |
| | | |
| | | /** |
| | | * æ£è
åºæ¬ä¿¡æ¯ |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean patientInfo(Map<String, List> map) { |
| | | System.out.println("patientInfoæ£è
åºæ¬ä¿¡æ¯ : " + map); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ£è
è¯æä¿¡æ¯ä¿®æ¹ |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean patientInfoEdit(Map<String, List> map) { |
| | | System.out.println("patientInfoEditæ£è
è¯æä¿¡æ¯ä¿®æ¹ : " + map); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æ£è
å
¥é¢ |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean patientHospitalized(Map<String, List> map) { |
| | | System.out.println("patientHospitalizedæ£è
å
¥é¢ : " + map); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.smartor.domain.ServiceThirdData; |
| | | import com.smartor.service.IServiceThirdDataService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹ååæ°æ®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-10-10 |
| | | */ |
| | | @Service |
| | | public class ServiceThirdDataServiceImpl implements IServiceThirdDataService { |
| | | |
| | | |
| | | @Override |
| | | public List<ServiceThirdData> queryList(ServiceThirdData serviceThirdData) { |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.smartor.mapper.ServiceThirdDataMapper"> |
| | | |
| | | <resultMap type="com.smartor.domain.ServiceThirdData" id="ServiceThirdDataResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="dataType" column="data_type"/> |
| | | <result property="dataTypeExplain" column="data_tepe_explain"/> |
| | | <result property="dataInfo" column="data_info"/> |
| | | <result property="factory" column="factory"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="isDeal" column="is_deal"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectServiceThirdDataVo"> |
| | | select id, data_type, data_type_explain, data_info, factory, create_time, is_deal |
| | | from service_third_data |
| | | </sql> |
| | | |
| | | <select id="selectServiceThirdDataList" parameterType="com.smartor.domain.ServiceThirdData" |
| | | resultMap="ServiceThirdDataResult"> |
| | | <include refid="selectServiceThirdDataVo"/> |
| | | <where> |
| | | <if test="dataType != null and dataType != ''">and data_type = #{dataType}</if> |
| | | <if test="dataTypeExplain != null and dataTypeExplain != ''">and data_type_explain = #{dataTypeExplain} |
| | | </if> |
| | | <if test="dataInfo != null and dataInfo != ''">and data_info = #{dataInfo}</if> |
| | | <if test="factory != null and factory != ''">and factory = #{factory}</if> |
| | | <if test="isDeal != null">and is_deal = #{isDeal}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insertThirdData" parameterType="com.smartor.domain.ServiceThirdData"> |
| | | insert into service_third_data |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="dataType != null">data_type,</if> |
| | | <if test="dataTypeExplain != null">data_type_explain,</if> |
| | | <if test="dataInfo != null">data_info,</if> |
| | | <if test="factory != null">factory,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="isDeal != null">is_deal,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="dataType != null">#{dataType},</if> |
| | | <if test="dataTypeExplain != null">#{dataTypeExplain},</if> |
| | | <if test="dataInfo != null">#{dataInfo},</if> |
| | | <if test="factory != null">#{factory},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="isDeal != null">#{isDeal}</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | </mapper> |