升级到springmvc6容器。
This commit is contained in:
		@@ -52,13 +52,43 @@
 | 
				
			|||||||
      <version>${spring.version}</version>
 | 
					      <version>${spring.version}</version>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- <dependency>
 | 
				
			||||||
 | 
					      <groupId>org.apache.commons</groupId>
 | 
				
			||||||
 | 
					      <artifactId>commons-fileupload2-jakarta-servlet6</artifactId>
 | 
				
			||||||
 | 
					      <version>2.0.0-M2</version>
 | 
				
			||||||
 | 
					    </dependency>
 | 
				
			||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
 | 
					      <groupId>commons-io</groupId>
 | 
				
			||||||
 | 
					      <artifactId>commons-io</artifactId>
 | 
				
			||||||
 | 
					      <version>2.18.0</version>
 | 
				
			||||||
 | 
					    </dependency> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- <dependency>
 | 
				
			||||||
 | 
					      <groupId>commons-fileupload</groupId>
 | 
				
			||||||
 | 
					      <artifactId>commons-fileupload</artifactId>
 | 
				
			||||||
 | 
					      <version>1.5</version>
 | 
				
			||||||
 | 
					    </dependency>
 | 
				
			||||||
 | 
					    <dependency>
 | 
				
			||||||
 | 
					      <groupId>commons-io</groupId>
 | 
				
			||||||
 | 
					      <artifactId>commons-io</artifactId>
 | 
				
			||||||
 | 
					      <version>2.18.0</version>
 | 
				
			||||||
 | 
					    </dependency> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <!-- <dependency>
 | 
				
			||||||
      <groupId>javax.servlet</groupId>
 | 
					      <groupId>javax.servlet</groupId>
 | 
				
			||||||
      <artifactId>javax.servlet-api</artifactId>
 | 
					      <artifactId>javax.servlet-api</artifactId>
 | 
				
			||||||
      <version>4.0.1</version>
 | 
					      <version>4.0.1</version>
 | 
				
			||||||
      <scope>provided</scope>
 | 
					      <scope>provided</scope>
 | 
				
			||||||
 | 
					    </dependency> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <dependency>
 | 
				
			||||||
 | 
					      <groupId>jakarta.servlet</groupId>
 | 
				
			||||||
 | 
					      <artifactId>jakarta.servlet-api</artifactId>
 | 
				
			||||||
 | 
					      <version>6.1.0</version>
 | 
				
			||||||
 | 
					      <scope>provided</scope>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- log4j -->
 | 
					    <!-- log4j -->
 | 
				
			||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>org.apache.logging.log4j</groupId>
 | 
					      <groupId>org.apache.logging.log4j</groupId>
 | 
				
			||||||
@@ -120,9 +150,9 @@
 | 
				
			|||||||
          <groupId>org.apache.maven.plugins</groupId>
 | 
					          <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
          <artifactId>maven-war-plugin</artifactId>
 | 
					          <artifactId>maven-war-plugin</artifactId>
 | 
				
			||||||
          <version>3.4.0</version>
 | 
					          <version>3.4.0</version>
 | 
				
			||||||
          <configuration>
 | 
					          <!-- <configuration>
 | 
				
			||||||
            <outputDirectory>${project.build.directory}/../../../输出/back/</outputDirectory>
 | 
					            <outputDirectory>${project.build.directory}/../../../输出/back/</outputDirectory>
 | 
				
			||||||
          </configuration>
 | 
					          </configuration> -->
 | 
				
			||||||
        </plugin>
 | 
					        </plugin>
 | 
				
			||||||
        <plugin>
 | 
					        <plugin>
 | 
				
			||||||
          <groupId>org.apache.maven.plugins</groupId>
 | 
					          <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,13 +15,16 @@ import org.springframework.web.bind.annotation.RequestBody;
 | 
				
			|||||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
					import org.springframework.web.bind.annotation.RequestMapping;
 | 
				
			||||||
import org.springframework.web.bind.annotation.ResponseBody;
 | 
					import org.springframework.web.bind.annotation.ResponseBody;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.databind.JsonMappingException;
 | 
				
			||||||
import com.fasterxml.jackson.databind.ObjectMapper;
 | 
					import com.fasterxml.jackson.databind.ObjectMapper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
					import org.springframework.web.bind.annotation.PostMapping;
 | 
				
			||||||
import org.slf4j.Logger;
 | 
					import org.slf4j.Logger;
 | 
				
			||||||
import org.slf4j.LoggerFactory;
 | 
					import org.slf4j.LoggerFactory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.cpic.xim.utils.secrecy.*;;
 | 
					import com.cpic.xim.utils.secrecy.*;
 | 
				
			||||||
 | 
					import com.cpic.xim.huixiabao.web.data.nhs.xyx.HmbXyxInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Controller
 | 
					@Controller
 | 
				
			||||||
@RequestMapping( "/huixiabao" )
 | 
					@RequestMapping( "/huixiabao" )
 | 
				
			||||||
@@ -37,21 +40,38 @@ public class MediCoverController
 | 
				
			|||||||
     * @param request
 | 
					     * @param request
 | 
				
			||||||
     * @return
 | 
					     * @return
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @PostMapping( "/xyx" )
 | 
					    @PostMapping( "/xyx.do" )
 | 
				
			||||||
    @ResponseBody
 | 
					    @ResponseBody
 | 
				
			||||||
    public static MediCoverResponse getHmbXyxInfo(
 | 
					    public static MediCoverResponse getHmbXyxInfo(
 | 
				
			||||||
            @RequestBody MediCoverRequestBody request
 | 
					            @RequestBody MediCoverRequestBody request
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        MediCoverResponse response   = new MediCoverResponse();
 | 
					 | 
				
			||||||
        ObjectMapper      jsonMapper = new ObjectMapper();
 | 
					        ObjectMapper      jsonMapper = new ObjectMapper();
 | 
				
			||||||
 | 
					        MediCoverResponse response   = null;
 | 
				
			||||||
 | 
					        HmbXyxInfo        xyxInfo    = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        String decryptData = AESUtils.decryptData( request.getKey(), privateKey, request.getBizContent() );
 | 
					        String decryptData = AESUtils.decryptData( request.getKey(), privateKey, request.getBizContent() );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        logger.info( "【接收小药箱数据】请求参数<{}>", request.toString() );
 | 
					        logger.info( "【接收小药箱数据】请求参数<{}>", request.toString() );
 | 
				
			||||||
        logger.info( "【接收小药箱数据】解密参数<{}>", decryptData );
 | 
					        logger.info( "【接收小药箱数据】解密参数<{}>", decryptData );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // jsonMapper.readValue( decryptData, null );
 | 
					        try
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            xyxInfo = jsonMapper.readValue( decryptData, HmbXyxInfo.class );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        catch ( Exception error )
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 解析json错误。
 | 
				
			||||||
 | 
					            response = new MediCoverResponse( "500",
 | 
				
			||||||
 | 
					                                              "解析JSON失败:" + error.getMessage(),
 | 
				
			||||||
 | 
					                                              "",
 | 
				
			||||||
 | 
					                                              "",
 | 
				
			||||||
 | 
					                                              "",
 | 
				
			||||||
 | 
					                                              false );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return response;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        return response;
 | 
					        return response;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -45,6 +45,8 @@ public class MediCoverRequestBody
 | 
				
			|||||||
        this.timestamp  = timestamp;
 | 
					        this.timestamp  = timestamp;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public MediCoverRequestBody() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public String getTransId()
 | 
					    public String getTransId()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return transId;
 | 
					        return transId;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,53 @@
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * @Author: Kane
 | 
					 * @Author: Kane Wang <wangkane@qq.com>
 | 
				
			||||||
 * @Date: 2025-03-16 00:12:27
 | 
					 * @Date: 2025-03-16 08:41:32
 | 
				
			||||||
 * @LastEditors: Kane
 | 
					 * @LastEditors: Kane Wang
 | 
				
			||||||
 * @FilePath: /cpicxim-huixiabao/src/main/java/com/cpic/xim/huixiabao/web/data/nhs/HmbXyxInfo.java
 | 
					 * @LastModified: 2025-03-16 20:00:26
 | 
				
			||||||
 | 
					 * @FilePath: src/main/java/com/cpic/xim/huixiabao/web/data/nhs/xyx/HmbXyxInfo.java
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
 * 
 | 
					 * 
 | 
				
			||||||
 *               Copyright (c) ${2023} by Kane, All Rights Reserved.
 | 
					 *               Copyright (c) 2025 by Kane All rights reserved
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
package com.cpic.xim.huixiabao.web.data.nhs.xyx;
 | 
					package com.cpic.xim.huixiabao.web.data.nhs.xyx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.Vector;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.annotation.JsonProperty;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class HmbXyxInfo
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public HmbXyxInfo()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public HmbXyxInfo( String topic, Vector<HmbXyxInfoItem> hmbList )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        this.topic   = topic;
 | 
				
			||||||
 | 
					        this.hmbList = hmbList;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public String getTopic()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return topic;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void setTopic( String topic )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        this.topic = topic;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public Vector<HmbXyxInfoItem> getHmbList()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return hmbList;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void setHmbList( Vector<HmbXyxInfoItem> hmbList )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        this.hmbList = hmbList;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @JsonProperty( "topic" )
 | 
				
			||||||
 | 
					    private String topic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @JsonProperty( "hmbList" )
 | 
				
			||||||
 | 
					    private Vector<HmbXyxInfoItem> hmbList;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class HmbXyxInfoItem
 | 
					public class HmbXyxInfoItem
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public HmbXyxInfoItem() {}
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    public String getPsnName()
 | 
					    public String getPsnName()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,13 +11,13 @@
 | 
				
			|||||||
package com.cpic.xim.web.filters.cros;
 | 
					package com.cpic.xim.web.filters.cros;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.IOException;
 | 
					import java.io.IOException;
 | 
				
			||||||
import javax.servlet.Filter;
 | 
					import jakarta.servlet.Filter;
 | 
				
			||||||
import javax.servlet.FilterChain;
 | 
					import jakarta.servlet.FilterChain;
 | 
				
			||||||
import javax.servlet.ServletException;
 | 
					import jakarta.servlet.ServletException;
 | 
				
			||||||
import javax.servlet.ServletRequest;
 | 
					import jakarta.servlet.ServletRequest;
 | 
				
			||||||
import javax.servlet.ServletResponse;
 | 
					import jakarta.servlet.ServletResponse;
 | 
				
			||||||
import javax.servlet.http.HttpServletRequest;
 | 
					import jakarta.servlet.http.HttpServletRequest;
 | 
				
			||||||
import javax.servlet.http.HttpServletResponse;
 | 
					import jakarta.servlet.http.HttpServletResponse;
 | 
				
			||||||
import org.slf4j.Logger;
 | 
					import org.slf4j.Logger;
 | 
				
			||||||
import org.slf4j.LoggerFactory;
 | 
					import org.slf4j.LoggerFactory;
 | 
				
			||||||
import org.springframework.http.HttpMethod;
 | 
					import org.springframework.http.HttpMethod;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,10 +28,10 @@
 | 
				
			|||||||
        <property name="suffix" value=".jsp" />
 | 
					        <property name="suffix" value=".jsp" />
 | 
				
			||||||
    </bean> -->
 | 
					    </bean> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <bean id="multipartResolver"
 | 
					    <!-- <bean id="multipartResolver"
 | 
				
			||||||
        class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
 | 
					        class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
 | 
				
			||||||
        <property name="defaultEncoding" value="UTF-8" />
 | 
					        <property name="defaultEncoding" value="UTF-8" />
 | 
				
			||||||
        <property name="maxUploadSize" value="-1" />
 | 
					        <property name="maxUploadSize" value="-1" />
 | 
				
			||||||
    </bean>
 | 
					    </bean> -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</beans>
 | 
					</beans>
 | 
				
			||||||
@@ -17,9 +17,9 @@
 | 
				
			|||||||
    </init-param>
 | 
					    </init-param>
 | 
				
			||||||
    <load-on-startup>1</load-on-startup>
 | 
					    <load-on-startup>1</load-on-startup>
 | 
				
			||||||
  </servlet>
 | 
					  </servlet>
 | 
				
			||||||
    <servlet-mapping>
 | 
					  <servlet-mapping>
 | 
				
			||||||
    <servlet-name>springmvc</servlet-name>
 | 
					    <servlet-name>springmvc</servlet-name>
 | 
				
			||||||
    <url-pattern>/huixibao</url-pattern>
 | 
					    <url-pattern>/</url-pattern>
 | 
				
			||||||
  </servlet-mapping>
 | 
					  </servlet-mapping>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <filter>
 | 
					  <filter>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user