|
@@ -242,7 +242,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
.setSourceType(askGoods3.getSourceType())
|
|
|
.setMoveType(askGoods3.getMoveType());
|
|
|
askGoodsMapper.addReturnGsRemovalF(returRemoval1);//新增返回gs数据父表信息
|
|
|
- map.put("data", askGoods3.getAskGoodsId());
|
|
|
+ map.put("data", removalCode);
|
|
|
map.put("msg", "200");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@@ -263,45 +263,52 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void plugOutRemoval(String removalCode) {
|
|
|
try{
|
|
|
- List<Map<String, Object>> mapList = askGoodsMapper.plugOutRemoval(removalCode);
|
|
|
- if(mapList.size() >0 ) {
|
|
|
- JSONObject returnData = new JSONObject();
|
|
|
-
|
|
|
- JSONObject strJson = new JSONObject();
|
|
|
- //父表
|
|
|
- strJson.put("askGoodsId", mapList.get(0).get("askGoodsId").toString());//要货单id
|
|
|
- strJson.put("removalCode", mapList.get(0).get("removalCode").toString());//出库单编号
|
|
|
- strJson.put("sourceType", mapList.get(0).get("sourceType").toString());//来源类型
|
|
|
- strJson.put("moveType", mapList.get(0).get("moveType").toString());//移动类型
|
|
|
- //子表
|
|
|
- List<JSONObject> list = new LinkedList<>();
|
|
|
- for(Map<String,Object> map:askGoodsMapper.getRemovalz(mapList.get(0).get("askGoodsId").toString())) {
|
|
|
- JSONObject BillItems = new JSONObject();
|
|
|
- BillItems.put("entryNumber", map.get("entryNumber"));//分录ID
|
|
|
-// BillItems.put("PurOrderID", returnWarehousing.getOrderNumber());//采购单id
|
|
|
-// BillItems.put("PurOrderItemID", returnWarehousing.getEntryNumber());//采购订单明细ID
|
|
|
- BillItems.put("Material", map.get("materialId"));//物料id
|
|
|
- BillItems.put("Quantity", map.get("num"));//数量
|
|
|
- BillItems.put("FlexField1", map.get("wbs"));//wbs
|
|
|
- BillItems.put("FlexField1Code", " ");//WBS编号
|
|
|
- BillItems.put("FlexField1Name", " ");//WBS名称
|
|
|
- list.add(BillItems);
|
|
|
- }
|
|
|
- strJson.put("BillItems", list);
|
|
|
- returnData.put("strJson", JSON.toJSONString(strJson));
|
|
|
- System.out.println(returnData);
|
|
|
- HttpClientUtil httpClientUtil1 = new HttpClientUtil();
|
|
|
- Map<String, Object> result = httpClientUtil1.doPost("http://localhost:3339/api/Values", returnData);
|
|
|
- if (Integer.parseInt(result.get("msg").toString()) != 200) {
|
|
|
- //如果失败存入报错信息跟数据
|
|
|
- Error error = new Error()
|
|
|
- .setErrorInfo(result.get("data").toString())
|
|
|
- .setUrl("http://localhost:44303/api/Values")
|
|
|
- .setDataVal(strJson.toJSONString());
|
|
|
- errorMapper.addError(error);
|
|
|
-
|
|
|
+ JSONObject returnData = new JSONObject();
|
|
|
+ List<JSONObject> retunList = new LinkedList<>();
|
|
|
+ for(String warehouseWhere : askGoodsMapper.getWarehouseWhere(removalCode)){
|
|
|
+ List<Map<String, Object>> mapList = askGoodsMapper.plugOutRemoval(removalCode);
|
|
|
+ if(mapList.size() >0 ) {
|
|
|
+ JSONObject strJson = new JSONObject();
|
|
|
+ //父表
|
|
|
+ strJson.put("GIReqBillID", mapList.get(0).get("askGoodsId").toString());//要货单id
|
|
|
+ strJson.put("WMSID", mapList.get(0).get("askGoodsId").toString());//出库单id
|
|
|
+ strJson.put("WMSCode", mapList.get(0).get("removalCode").toString());//出库单编号
|
|
|
+ strJson.put("WareHouse", warehouseWhere);//仓库ID1
|
|
|
+ strJson.put("SourceBillDate", mapList.get(0).get("removalCode").toString());//业务日期1
|
|
|
+ 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
|
|
|
+ //子表
|
|
|
+ List<JSONObject> list = new LinkedList<>();
|
|
|
+ for (Map<String, Object> map : askGoodsMapper.getRemovalz(mapList.get(0).get("askGoodsId").toString(), warehouseWhere)) {
|
|
|
+ JSONObject BillItems = new JSONObject();
|
|
|
+ BillItems.put("WMSItemID", map.get("entryNumber"));//分录ID
|
|
|
+ BillItems.put("GIReqBillID", map.get("askGoodsId"));//要货申请单ID
|
|
|
+ BillItems.put("GIReqBillItemID", map.get("id"));//要货申请明细ID
|
|
|
+ BillItems.put("Material", map.get("materialId"));//物料id
|
|
|
+ BillItems.put("Quantity", map.get("num"));//数量
|
|
|
+ BillItems.put("FlexField1", map.get("wbs"));//wbs
|
|
|
+ BillItems.put("FlexField1Code", " ");//WBS编号
|
|
|
+ BillItems.put("FlexField1Name", " ");//WBS名称
|
|
|
+ list.add(BillItems);
|
|
|
+ }
|
|
|
+ strJson.put("BillItems", list);
|
|
|
+ retunList.add(strJson);
|
|
|
}
|
|
|
}
|
|
|
+ returnData.put("strJson", JSON.toJSONString(retunList));
|
|
|
+ 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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|