|
@@ -257,7 +257,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 出库回传
|
|
|
- * @param removalCode
|
|
|
+ * @param removalCode 单据id
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -275,8 +275,8 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
strJson.put("WMSCode", mapList.get(0).get("removalCode").toString());//出库单编号
|
|
|
strJson.put("WareHouse", warehouseWhere);//仓库ID
|
|
|
strJson.put("SourceBillDate",DateUtil.dateConversion(mapList.get(0).get("scrq").toString()));//业务日期
|
|
|
- strJson.put("sourceType", mapList.get(0).get("sourceType").toString());//来源类型
|
|
|
- strJson.put("moveType", mapList.get(0).get("moveType").toString());//移动类型
|
|
|
+ strJson.put("SourceType", mapList.get(0).get("sourceType").toString());//来源类型
|
|
|
+ strJson.put("MoveType", mapList.get(0).get("moveType").toString());//移动类型
|
|
|
strJson.put("IsRed", 0);//是否红单1
|
|
|
strJson.put("Creator", "测试");//制单人姓名1
|
|
|
//子表
|
|
@@ -297,18 +297,30 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
retunList.add(strJson);
|
|
|
}
|
|
|
}
|
|
|
- returnData.put("strJson", JSON.toJSONString(retunList));
|
|
|
+ JSONObject ReqOutStocks = new JSONObject();
|
|
|
+ ReqOutStocks.put("ReqOutStocks",retunList);
|
|
|
+ returnData.put("strJson", JSON.toJSONString(ReqOutStocks));
|
|
|
System.out.println(returnData);
|
|
|
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/CreatePurInStock", returnData);
|
|
|
-
|
|
|
+ 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) {
|
|
|
- //如果失败存入报错信息跟数据
|
|
|
- Error error = new Error()
|
|
|
- .setErrorInfo(result.get("data").toString())
|
|
|
- .setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreatePurInStock")
|
|
|
- .setDataVal(JSON.toJSONString(retunList));
|
|
|
- errorMapper.addError(error);
|
|
|
+ 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()
|
|
|
+ .setErrorInfo(datum.toString())
|
|
|
+ .setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock")
|
|
|
+ .setDataVal(JSON.toJSONString(returnData));
|
|
|
+ errorMapper.addError(error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ System.out.println("报错信息为:"+result.get("data"));
|
|
|
+ }
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|