|
@@ -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;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|