|
@@ -122,7 +122,6 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
List<String> scanNum = new LinkedList<>();
|
|
|
for(AskGoods askGoods1 : list){
|
|
|
askGoods1.setUniqueCode(askGoods.getUniqueCode());
|
|
|
- askGoods1.setAskGoodsId(askGoods.getAskGoodsId());
|
|
|
askGoods1.setWllbCode(askGoods1.getMaterialCode());
|
|
|
scanNum.add(askGoodsMapper.getScanNum(askGoods1));//扫描总数
|
|
|
}
|
|
@@ -178,7 +177,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
int alreadyNum = askGoodsMapper.getAskInfoNumVitrual(askGoods);//已扫描总数
|
|
|
int inventoryAlready = askGoodsMapper.getInventoryAlready(askGoods);//库存已扫描数量
|
|
|
int inventorySurplus = (Integer.parseInt(inventory.getAmount()) - Integer.parseInt(inventory.getAmountLock())) - inventoryAlready; //库存剩余数量
|
|
|
- int surplusNum = Integer.parseInt(askGoods1.getNum()) - alreadyNum; //剩余要扫描数量
|
|
|
+ Double surplusNum = Double.parseDouble(askGoods1.getNum()) - alreadyNum; //剩余要扫描数量
|
|
|
|
|
|
if(surplusNum >= inventorySurplus){
|
|
|
askGoods.setNum(String.valueOf(inventorySurplus));
|
|
@@ -214,7 +213,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
throw new Exception("库存不存在");
|
|
|
}
|
|
|
//如果出库库存等于虚拟表库存则删除此库存
|
|
|
- if(Integer.parseInt(askGoods.getNum()) == Integer.parseInt(inventory.getAmount())){
|
|
|
+ if(Double.parseDouble(askGoods.getNum()) == Double.parseDouble(inventory.getAmount())){
|
|
|
askGoodsMapper.deleteInventory(inventory);
|
|
|
} else {
|
|
|
inventory.setAmount(askGoods.getNum());
|
|
@@ -326,11 +325,15 @@ public class AskGoodsServiceImpl implements AskGoodsService {
|
|
|
List<JSONObject> data1 = (List<JSONObject>) JSONObject.parse(jsonObject1.get("data").toString());
|
|
|
for (JSONObject map : data1) {
|
|
|
if (map.get("State").toString().equals("0")){
|
|
|
- //如果失败存入报错信息跟数据
|
|
|
- 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);
|
|
|
+ for(JSONObject jsonObject2 : retunList){
|
|
|
+ if(jsonObject2.get("WMSCode").toString().equals(map.get("WMSCode")) && jsonObject2.get("WareHouse").toString().equals(map.get("WareHouse"))){
|
|
|
+ //如果失败存入报错信息跟数据
|
|
|
+ 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(jsonObject2.toString());
|
|
|
+ errorMapper.addError(error);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|