去掉报错

datasource
yewj 7 months ago
parent 8191ec7324
commit f40c019f6a

@ -10,10 +10,10 @@ import com.glxp.mipsdl.req.base.UdiwmsQueryUdiInvProductsRequest;
import com.glxp.mipsdl.res.BaseResponse; import com.glxp.mipsdl.res.BaseResponse;
import com.glxp.mipsdl.thirddao.njxyy.TestDataMapper; import com.glxp.mipsdl.thirddao.njxyy.TestDataMapper;
import com.glxp.mipsdl.util.ResultVOUtils; import com.glxp.mipsdl.util.ResultVOUtils;
import com.jacob.activeX.ActiveXComponent; //import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread; //import com.jacob.com.ComThread;
import com.jacob.com.Dispatch; //import com.jacob.com.Dispatch;
import com.jacob.com.Variant; //import com.jacob.com.Variant;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -52,31 +52,31 @@ public class TestController {
} }
@GetMapping("/test/yh") // @GetMapping("/test/yh")
public BaseResponse yh() { // public BaseResponse yh() {
Variant result = this.yhHttp(); // Variant result = this.yhHttp();
return ResultVOUtils.success(result.toString()) ; // return ResultVOUtils.success(result.toString()) ;
} // }
//
public Variant yhHttp() { // public Variant yhHttp() {
ComThread.InitSTA(false); // ComThread.InitSTA(false);
ActiveXComponent component = new ActiveXComponent("YinHai.CHS.InterfaceSCS"); // ActiveXComponent component = new ActiveXComponent("YinHai.CHS.InterfaceSCS");
// ActiveXComponent component = new ActiveXComponent("Excel.Application"); //// ActiveXComponent component = new ActiveXComponent("Excel.Application");
Variant result = null; // Variant result = null;
try { // try {
// 获取 COM 组件的 Dispatch 对象 // // 获取 COM 组件的 Dispatch 对象
Dispatch dispatch = (Dispatch) component.getObject(); // Dispatch dispatch = (Dispatch) component.getObject();
String rest = null; // String rest = null;
String input = "{}"; // String input = "{}";
// 直接调用方法 // // 直接调用方法
result = Dispatch.invoke(dispatch, "yh_CHS_init", Dispatch.Method, // result = Dispatch.invoke(dispatch, "yh_CHS_init", Dispatch.Method,
new Object[]{"1101", input, rest}, new int[1]); // new Object[]{"1101", input, rest}, new int[1]);
//
} finally { // } finally {
// 关闭 COM 组件,释放资源 // // 关闭 COM 组件,释放资源
component.safeRelease(); // component.safeRelease();
} // }
return result; // return result;
} // }
} }

Loading…
Cancel
Save