liusheng
2024-06-19 e52b0e34fc06372aab64c30b526ec289b99c9af7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/socket/SocketCommunication.java
@@ -7,7 +7,6 @@
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;
@@ -15,14 +14,9 @@
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
@@ -85,8 +79,8 @@
            //获取返回数据
            String messageControlID = list.get(9);
            String timeOfAnEvent = list.get(6);
            String senderApp = list.get(2);
            String senderFac = list.get(3);
//            String senderApp = list.get(2);
//            String senderFac = list.get(3);
            String dataType = list.get(8);
            if (StringUtils.isNotEmpty(dataType)) {
@@ -104,10 +98,13 @@
            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().getSendingApplication().getNamespaceID().setValue("SF");
//            ack.getMSH().getSendingFacility().getNamespaceID().setValue(senderFac);
            ack.getMSH().getSendingFacility().getNamespaceID().setValue("SF");
//            ack.getMSH().getReceivingApplication().getNamespaceID().setValue(senderApp);
            ack.getMSH().getReceivingApplication().getNamespaceID().setValue("QN");
//            ack.getMSH().getReceivingFacility().getNamespaceID().setValue(senderFac);
            ack.getMSH().getReceivingFacility().getNamespaceID().setValue("QN");
            ack.getMSH().getDateTimeOfMessage().getTimeOfAnEvent().setValue(timeOfAnEvent);
            ack.getMSH().getMessageType().getMessageType().setValue("ACK");
            ack.getMSH().getMessageType().getTriggerEvent().setValue("ACK");