Browse Source

MES端口号更改

koul 1 year ago
parent
commit
04bcc806da

+ 31 - 1
src/main/java/com/uas/eis/service/Impl/ERPServiceImpl.java

@@ -168,7 +168,7 @@ public class ERPServiceImpl implements ERPService {
                         new BeanPropertyRowMapper<ProdInOutMakeGive>(ProdInOutMakeGive.class), piId);
                         new BeanPropertyRowMapper<ProdInOutMakeGive>(ProdInOutMakeGive.class), piId);
                 List<ProdInOutMakeGiveDetail> prodInOutMakeGiveDetails = baseDao.query("select pd_prodcode,pd_outqty,pd_id,pd_orderdetno from prodiodetail where pd_piid=" + piId, ProdInOutMakeGiveDetail.class);
                 List<ProdInOutMakeGiveDetail> prodInOutMakeGiveDetails = baseDao.query("select pd_prodcode,pd_outqty,pd_id,pd_orderdetno from prodiodetail where pd_piid=" + piId, ProdInOutMakeGiveDetail.class);
                 prodInOutMakeGive.setDetail(prodInOutMakeGiveDetails);
                 prodInOutMakeGive.setDetail(prodInOutMakeGiveDetails);
-                Map<String, Object> map = syncMESCheckBomItems(JSON.toJSONString(prodInOutMakeGive, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncInOutMakeGive"));
+                Map<String, Object> map = jsonArray(JSON.toJSONString(prodInOutMakeGive, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncInOutMakeGive"));
                 hashMap.put("code", -1);
                 hashMap.put("code", -1);
                 hashMap.put("msg", "MES异常,请联系MES处理!");
                 hashMap.put("msg", "MES异常,请联系MES处理!");
                 if (map != null&&!map.isEmpty()) {
                 if (map != null&&!map.isEmpty()) {
@@ -369,4 +369,34 @@ public class ERPServiceImpl implements ERPService {
         }
         }
         return map;
         return map;
     }
     }
+
+    private Map<String, Object> jsonArray(String params,String url){
+        Map<String, Object> map = new HashMap<>();
+        map.put("code",-1);
+        logger.info("params:"+params);
+        try {
+            String post = PSHttpUtils.sendPost(tokenConfig.get("mesHttp") + url, params);
+            logger.info("post:"+post);
+            JSONObject jsonObject;
+            JSONArray objects = JSON.parseArray(post);
+            Object obj = objects.get(0);
+            jsonObject=JSON.parseObject(StringUtil.nvl(obj,"{}"));
+            int code= jsonObject.getIntValue("msgId");
+            String msg=jsonObject.getString("msgStr");
+            if (code==0){
+                map.put("code",code);
+                map.put("msg","同步MES成功");
+            }else if(code==1){
+                map.put("code",code);
+                map.put("msg",msg);
+            }else {
+                map.put("msg","接口调用异常,错误代码:"+code+",请联系MES处理!");
+            }
+        }catch (Exception e){
+            map.put("msg","接口调用异常,异常信息:"+e.getMessage()+",请联系MES处理!");
+            logger.info("异常信息:"+e.getMessage());
+            e.printStackTrace();
+        }
+        return map;
+    }
 }
 }

+ 1 - 1
src/main/resources/api_sign_key_mapping.properties

@@ -1,7 +1,7 @@
 BOYT=f9d17c1047fd468081e39ce33bb41bb7
 BOYT=f9d17c1047fd468081e39ce33bb41bb7
 mesUser=ERP
 mesUser=ERP
 mesPwd=erp.com
 mesPwd=erp.com
-mesHttp=http://192.168.16.114:8080/mrs/
+mesHttp=http://192.168.16.114:8070/mrs/
 syncProduct=updateItemByErp
 syncProduct=updateItemByErp
 syncMakeBase=updateProdByErp
 syncMakeBase=updateProdByErp
 syncMakeBaseDetail=updateProdBomByErp
 syncMakeBaseDetail=updateProdBomByErp