Browse Source

修改 过账捕获异常信息BUG

chenjx 5 years ago
parent
commit
037584e1ce

+ 5 - 0
src/main/java/com/uas/eis/serviceImpl/ProdInOutServiceImpl.java

@@ -46,6 +46,11 @@ public class ProdInOutServiceImpl implements ProdInOutService {
             Response response = HttpUtil.sendPostRequest(Url,header,params,false,null);
             String res = response.getResponseText();
             JSONObject jsonObject = JSON.parseObject(res);
+            if (jsonObject.getString("exceptionInfo")!=null && jsonObject.getString("exceptionInfo")!=""){
+                modelMap.put("success", false);
+                modelMap.put("error",jsonObject.getString("exceptionInfo"));
+                return modelMap;
+            }
             if(!jsonObject.getBoolean("success")){
                 modelMap.put("success", false);
                 modelMap.put("error",piClass+"(inoutno)过账失败!");

+ 8 - 2
src/main/java/com/uas/eis/serviceImpl/XiangXServiceImpl.java

@@ -103,7 +103,10 @@ public class XiangXServiceImpl implements XiangXService {
             try {
                 //更新单据日期为当前时间
                 baseDao.updateByCondition("ProdInOut","pi_date=to_date('"+dealDate+"','yyyy-MM-dd')","pi_id="+inOutId);
-                prodInOutService.postProdInOut(inOutId, caller.toString(),master);
+                modelMap = prodInOutService.postProdInOut(inOutId, caller.toString(),master);
+                if (modelMap.get("success")!=null && "false".equals(modelMap.get("success").toString())){
+                    return modelMap;
+                }
             }catch (Exception e){
                 UpdateProdinOutLog(inOutId,false);
                 baseDao.execute("insert into ERPSYNC_MESSAGELOG (EL_ID,EL_DATA,EL_TYPE,EL_ERROR,EL_DATE,EL_STATUS,EL_CODE) values " +
@@ -121,7 +124,10 @@ public class XiangXServiceImpl implements XiangXService {
             try {
                 //更新单据日期为当前时间
                 baseDao.updateByCondition("ProdInOut","pi_date=to_date('"+dealDate+"','yyyy-MM-dd')","pi_id="+inOutId);
-                prodInOutService.postProdInOut(inOutId, caller.toString(),master);
+                modelMap = prodInOutService.postProdInOut(inOutId, caller.toString(), master);
+                if (modelMap.get("success")!=null && "false".equals(modelMap.get("success").toString())){
+                    return modelMap;
+                }
             }catch (Exception e){
                 UpdateProdinOutLog(inOutId,false);
                 baseDao.execute("insert into ERPSYNC_MESSAGELOG (EL_ID,EL_DATA,EL_TYPE,EL_ERROR,EL_DATE,EL_STATUS,EL_CODE) values " +