|
@@ -306,24 +306,43 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
HttpClientUtil httpClientUtil1 = new HttpClientUtil();
|
|
|
Map<String, Object> result = httpClientUtil1.doPost("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock", returnData);
|
|
|
System.out.println("result:"+result);
|
|
|
- if (Integer.parseInt(result.get("msg").toString()) != 200) {
|
|
|
- if (Integer.parseInt(result.get("msg").toString()) != 400){
|
|
|
- List<Map<String, Object>> data = (List<Map<String, Object>>) result.get("data");
|
|
|
- System.out.println("data:"+data);
|
|
|
- for (Map<String, Object> datum : data) {
|
|
|
- if (datum.get("State").equals("0")){
|
|
|
+ Error error = new Error();
|
|
|
+ if(Integer.parseInt(result.get("msg").toString()) != 200){
|
|
|
+ //如果失败存入报错信息跟数据
|
|
|
+ error.setErrorInfo(result.get("data").toString());
|
|
|
+ error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
|
|
|
+ error.setDataVal(returnData.toJSONString());
|
|
|
+ errorMapper.addError(error);
|
|
|
+ }else {
|
|
|
+ JSONObject jsonObject = (JSONObject) JSONObject.parse(result.get("data").toString());
|
|
|
+ JSONObject jsonObject1 = (JSONObject) JSONObject.parse(jsonObject.get("result").toString());
|
|
|
+ if ( jsonObject1.get("State").toString().equals("0") ){
|
|
|
+ //如果失败存入报错信息跟数据
|
|
|
+ error.setErrorInfo(jsonObject1.get("Msg").toString());
|
|
|
+ error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
|
|
|
+ error.setDataVal(returnData.toJSONString());
|
|
|
+ errorMapper.addError(error);
|
|
|
+ }else {
|
|
|
+ List<JSONObject> data1 = (List<JSONObject>) JSONObject.parse(jsonObject1.get("data").toString());
|
|
|
+ for (JSONObject map : data1) {
|
|
|
+ if (map.get("State").toString().equals("0")){
|
|
|
//如果失败存入报错信息跟数据
|
|
|
- Error error = new Error()
|
|
|
- .setErrorInfo(datum.toString())
|
|
|
- .setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock")
|
|
|
- .setDataVal(JSON.toJSONString(returnData));
|
|
|
+ error.setErrorInfo(map.get("FailReason").toString());
|
|
|
+ error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
|
|
|
+ error.setDataVal(map.toString());
|
|
|
errorMapper.addError(error);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
- System.out.println("报错信息为:"+result.get("data"));
|
|
|
}
|
|
|
}
|
|
|
+ //删除父子表信息
|
|
|
+ askGoodsMapper.delPlugOutRemoval(removalCode);
|
|
|
+ askGoodsMapper.delRemovalz(removalCode);
|
|
|
+ //添加记录到tld_access
|
|
|
+ String names = "出库回传" ;
|
|
|
+ String accessType = "1" ;
|
|
|
+ String returnGsRemoval = returnData.toString() ;
|
|
|
+ askGoodsMapper.addAccess(names,returnGsRemoval,accessType);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|