|
|
@@ -39,6 +39,9 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
private DeliveryMapper deliveryMapper;
|
|
|
@Autowired
|
|
|
private DictionaryMapper dictionaryMapper;
|
|
|
+ @Autowired
|
|
|
+ private QueryListMapper queryListMapper;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @Description: 要货申请单(生产领用申请)
|
|
|
@@ -129,12 +132,24 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
try{
|
|
|
List<AskGoods> list = askGoodsMapper.getAskGoodsMaterial(askGoods);
|
|
|
List<String> scanNum = new LinkedList<>();
|
|
|
+ List<String> mapVal = new LinkedList<>();
|
|
|
for(AskGoods askGoods1 : list){
|
|
|
askGoods1.setUniqueCode(askGoods.getUniqueCode());
|
|
|
askGoods1.setWllbCode(askGoods1.getMaterialCode());
|
|
|
scanNum.add(askGoodsMapper.getScanNum(askGoods1));//扫描总数
|
|
|
+ Inventory inventory = new Inventory()
|
|
|
+ .setMaterialId(askGoods1.getMaterialId())
|
|
|
+ .setWbs(askGoods1.getWbs())
|
|
|
+ .setCompanyCode(askGoods1.getCompanyNumber());
|
|
|
+ List<Map<String, Object>> inventorVal = queryListMapper.storageLocation(inventory);
|
|
|
+ if(inventorVal.size() != 0){
|
|
|
+ mapVal.add(inventorVal.get(0).get("sum").toString());
|
|
|
+ } else {
|
|
|
+ mapVal.add("0");
|
|
|
+ }
|
|
|
}
|
|
|
map.put("scanNum", scanNum);
|
|
|
+ map.put("sum", mapVal);
|
|
|
map.put("data", list);
|
|
|
map.put("msg", "200");
|
|
|
}catch (Exception e){
|
|
|
@@ -331,6 +346,10 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
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()).setType("出库回传");
|
|
|
+ //修改流水传输状态
|
|
|
+ for(Map<String, Object> map : askGoodsMapper.plugOutRemoval(removalCode)){
|
|
|
+ askGoodsMapper.updateRemoval(map.get("removalCode").toString());
|
|
|
+ }
|
|
|
errorMapper.addError(error);
|
|
|
type = 1;
|
|
|
}else {
|
|
|
@@ -342,6 +361,10 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
|
|
|
error.setDataVal(returnData.toJSONString()).setType("出库回传");
|
|
|
errorMapper.addError(error);
|
|
|
+ //修改流水传输状态
|
|
|
+ for(Map<String, Object> map : askGoodsMapper.plugOutRemoval(removalCode)){
|
|
|
+ askGoodsMapper.updateRemoval(map.get("removalCode").toString());
|
|
|
+ }
|
|
|
type = 1;
|
|
|
}else {
|
|
|
List<JSONObject> data1 = (List<JSONObject>) JSONObject.parse(jsonObject1.get("data").toString());
|
|
|
@@ -354,6 +377,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateProductiveOutStock");
|
|
|
error.setDataVal(jsonObject2.toString()).setType("出库回传");
|
|
|
errorMapper.addError(error);
|
|
|
+ askGoodsMapper.updateRemoval(jsonObject2.get("WMSCode").toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -737,10 +761,8 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
JSONObject ReqOutStocks = new JSONObject();
|
|
|
ReqOutStocks.put("BILLs",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/CreateBOLOutStock", returnData);
|
|
|
- System.out.println("result:"+result);
|
|
|
Error error = new Error();
|
|
|
if(Integer.parseInt(result.get("msg").toString()) != 200){
|
|
|
//如果失败存入报错信息跟数据
|
|
|
@@ -835,7 +857,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *移库单接口文档
|
|
|
+ * 移库单接口文档
|
|
|
*/
|
|
|
@Override
|
|
|
public void CreateGMReqOutStock(String removalCode) {
|
|
|
@@ -882,10 +904,8 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
ReqOutStocks.put("BILLs", retunList);
|
|
|
List<JSONObject> retunList1 = new LinkedList<>();
|
|
|
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/CreateGMReqOutStock", returnData);
|
|
|
- System.out.println("result:" + result);
|
|
|
Error error = new Error();
|
|
|
if (Integer.parseInt(result.get("msg").toString()) != 200) {
|
|
|
//如果失败存入报错信息跟数据
|
|
|
@@ -921,9 +941,9 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
}
|
|
|
//删除父子表信息
|
|
|
//根据code
|
|
|
-// askGoodsMapper.delReturnWarehouseTransfer(removalCode);
|
|
|
-// //根据id
|
|
|
-// askGoodsMapper.delReturnWarehouseTransferZ(warehouseTransferTd);
|
|
|
+ askGoodsMapper.delReturnWarehouseTransfer(removalCode);
|
|
|
+ //根据id
|
|
|
+ askGoodsMapper.delReturnWarehouseTransferZ(warehouseTransferTd);
|
|
|
//添加记录到tld_access
|
|
|
String names = "移库单";
|
|
|
String accessType = "1";
|
|
|
@@ -987,17 +1007,19 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
ReqOutStocks.put("BILLs", retunList);
|
|
|
List<JSONObject> retunList1 = new LinkedList<>();
|
|
|
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/CreateGRReqInStock", returnData);
|
|
|
- System.out.println("result:" + result);
|
|
|
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/CreateGRReqInStock");
|
|
|
- error.setDataVal(returnData.toJSONString()).setType("半成品入库");
|
|
|
+ error.setDataVal(returnData.toJSONString()).setType("生产收货");
|
|
|
errorMapper.addError(error);
|
|
|
+ //修改流水传输状态
|
|
|
+ for(Map<String, Object> map : askGoodsMapper.plugOutRemoval(removalCode)){
|
|
|
+ askGoodsMapper.updateRemoval(map.get("removalCode").toString());
|
|
|
+ }
|
|
|
} else {
|
|
|
JSONObject jsonObject = (JSONObject) JSONObject.parse(result.get("data").toString());
|
|
|
JSONObject jsonObject1 = (JSONObject) JSONObject.parse(jsonObject.get("result").toString());
|
|
|
@@ -1005,7 +1027,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
//如果失败存入报错信息跟数据
|
|
|
error.setErrorInfo(jsonObject1.get("Msg").toString());
|
|
|
error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateGRReqInStock");
|
|
|
- error.setDataVal(returnData.toJSONString()).setType("半成品入库");
|
|
|
+ error.setDataVal(returnData.toJSONString()).setType("生产收货");
|
|
|
errorMapper.addError(error);
|
|
|
} else {
|
|
|
List<JSONObject> data1 = (List<JSONObject>) JSONObject.parse(jsonObject1.get("data").toString());
|
|
|
@@ -1016,7 +1038,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
//如果失败存入报错信息跟数据
|
|
|
error.setErrorInfo(map.get("FailReason").toString());
|
|
|
error.setUrl("http://42.159.85.29:52480/cwbase/sg/V1/ERP/TELD/DEVTEST/API_WMS_PurInStock/CreateGRReqInStock");
|
|
|
- error.setDataVal(jsonObject2.toString()).setType("半成品入库");
|
|
|
+ error.setDataVal(jsonObject2.toString()).setType("生产收货");
|
|
|
errorMapper.addError(error);
|
|
|
}
|
|
|
}
|
|
|
@@ -1026,9 +1048,9 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
}
|
|
|
//删除父子表信息
|
|
|
//根据code
|
|
|
-// askGoodsMapper.delNoticeParent(returnWarehousing.getOrderNumber());
|
|
|
-// //根据id
|
|
|
-// askGoodsMapper.delNoticeSubtabulation(returnWarehousing.getOrderNumber());
|
|
|
+ askGoodsMapper.delNoticeParent(returnWarehousing.getOrderNumber());
|
|
|
+ //根据id
|
|
|
+ askGoodsMapper.delNoticeSubtabulation(returnWarehousing.getOrderNumber());
|
|
|
//添加记录到tld_access
|
|
|
String names = "报工单";
|
|
|
String accessType = "1";
|