From c1aa9d6634d3381f8a4ede687f0e9231ad747c90 Mon Sep 17 00:00:00 2001 From: 懒羊羊 <15939171744@163.com> Date: 星期五, 22 三月 2024 10:01:33 +0800 Subject: [PATCH] 工厂接口 --- jcdm-main/src/main/java/com/jcdm/main/restful/service/restfulService.java | 80 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 80 insertions(+), 0 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/restful/service/restfulService.java b/jcdm-main/src/main/java/com/jcdm/main/restful/service/restfulService.java new file mode 100644 index 0000000..3b3d08a --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/restful/service/restfulService.java @@ -0,0 +1,80 @@ +package com.jcdm.main.restful.service; + +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +public class restfulService { + public static final String getRealmName = "https://imes-test-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration"; + + public static final String postRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface"; + + public static final String siteCode = "9786"; + + /** + * 鐢熶骇宸ュ崟璇锋眰鎺ュ彛 + * @param productNum + * @param stationCode + * @return + */ + //{"code":"success","data":{"productNum":"LCV123456P0600036","stationCode":"1HZ01","materialCode":"LCV001_3","productionOrderNum":"500000258"},"message":"API璋冪敤鎴愬姛"} + public static String getProductionWorkOrderRequest(String productNum,String stationCode) + { + String url = getRealmName + "/productionWorkOrderRequest?siteCode="+siteCode+"&stationCode="+stationCode+"&productNum="+productNum; + HttpResponse response = HttpRequest.get(url).execute(); + HttpRequest httpRequest = HttpRequest.get(url); + return response.body(); + } + + /** + * AMES鎶ュ伐缁撴灉鍥炰紶 + * @param productNum + * @param stationCode + * @param confirmTime + * @return + */ + //{"code":"success","data":{"productNum":"LCV123456P0600036","stationCode":"1HZ01","resultCode":"S","resultText":"鎶ュ伐鎴愬姛"},"message":"API璋冪敤鎴愬姛"} + public static String getWorkReportResultFeedback(String productNum,String stationCode,String confirmTime) + { + String url = getRealmName + "/workReportResultFeedback?siteCode="+siteCode+"&stationCode="+stationCode+"&productNum="+productNum+"&confirmTime="+confirmTime; + HttpResponse response = HttpRequest.get(url).execute(); + HttpRequest httpRequest = HttpRequest.get(url); + return response.body(); + } + + /** + * 鐢熶骇宸ュ崟缁勪欢璇锋眰鎺ュ彛 + * @param productionOrderNum + * @return + * + */ + //{"code":"success","data":[{"productionOrderNum":"500000258","componentCode":"LCV_TZ_002","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_001","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_002","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_003","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_004","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_005","quantity":"1.0","stationCode":"C02"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_006","quantity":"1.0","stationCode":"C03"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_007","quantity":"1.0","stationCode":"C04"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_009","quantity":"2.0","stationCode":"C05"}],"message":"API璋冪敤鎴愬姛"} + public static String getProductionOrderComponentRequest(String productionOrderNum) + { + String url = getRealmName + "/productionOrderComponentRequest?siteCode="+siteCode+"&productionOrderNum="+productionOrderNum; + HttpResponse response = HttpRequest.get(url).execute(); + HttpRequest httpRequest = HttpRequest.get(url); + return response.body(); + } + + /** + * 浜у搧闃熷垪璇锋眰 + * @param productNum + * @param stationCode + * @return + */ + //{"code":"success","data":[{"configValues":{"FXPTX":"","ZJTX":"","JSYZYZC":"","CDGDTX":"","CHLXTX":""},"productTrackInfo":{"ProductNum":"LCVLCVTS3P0600388","StationCode":"1A03"}}],"message":"API璋冪敤鎴愬姛"} + public static String postPRODUCTION_QUEUE(String productNum,String stationCode) + { + String url = postRealmName + "/PRODUCTION_QUEUE"; + HttpResponse response = HttpRequest.post(url) + // 琛ㄥ崟鍙傛暟锛屽彲浠ラ�氳繃澶氭璋冪敤 form 鏂规硶娣诲姞澶氫釜鍙傛暟 + .form("siteCode", siteCode) + .form("interfaceCode", "PRODUCTION_QUEUE") + .form("parameter", "{\"productNum\":\""+productNum+"\",\"stationCode\":\""+stationCode+"\",\"requestQty\":1}") + // 鎵ц璇锋眰 + .execute(); + return response.body(); + } +} -- Gitblit v1.9.3