chengf
2025-07-28 04a9fbd79895f489e840ebb0d5dd62457b9ff5a5
service-api/src/main/java/com/java110/api/controller/component/CallComponentController.java
@@ -17,10 +17,10 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.api.smo.DefaultAbstractComponentSMO;
import com.java110.core.base.controller.BaseController;
import com.java110.core.context.IPageData;
import com.java110.core.context.PageData;
import com.java110.core.language.Java110Lang;
import com.java110.core.log.LoggerFactory;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.exception.SMOException;
import com.java110.utils.factory.ApplicationContextFactory;
@@ -29,14 +29,10 @@
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
@@ -105,6 +101,7 @@
            logger.error("调用api异常", e);
            responseEntity = new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("调用api异常", e);
            String msg = "";
            if (e instanceof InvocationTargetException) {
@@ -113,7 +110,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                msg ="调用异常";
                msg = e.getMessage();
            }
            responseEntity = new ResponseEntity<>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
        } finally {
@@ -174,9 +171,11 @@
        } catch (SMOException e) {
            /*MultiValueMap<String, String> headers = new HttpHeaders();
            headers.add("code", e.getResult().getCode());*/
            e.printStackTrace();
            logger.error("调用组件异常", e);
            responseEntity = new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("调用组件异常", e);
            String msg = "";
            if (e instanceof InvocationTargetException) {
@@ -185,6 +184,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                //msg = e.getMessage();
                msg ="调用异常";
            }
            responseEntity = new ResponseEntity<>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
@@ -218,7 +218,7 @@
            @PathVariable String componentCode,
            @PathVariable String componentMethod,
            @RequestParam("uploadFile") MultipartFile uploadFile,
            //@RequestBody String info,
            @RequestBody String userId,
            HttpServletRequest request) {
        ResponseEntity<String> responseEntity = null;
        Map formParam = null;
@@ -258,7 +258,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                msg ="调用异常";
                msg = e.getMessage();
            }
            responseEntity = new ResponseEntity<>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
        } finally {
@@ -321,7 +321,7 @@
                    msg = targetEx.getMessage();
                }
            } else {
                msg ="调用异常";
                msg = e.getMessage();
            }
            responseEntity = new ResponseEntity<Object>(msg, HttpStatus.INTERNAL_SERVER_ERROR);
        } finally {