¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | | } |