|
|
|
@ -126,6 +126,14 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
map.remove("producedDate"); |
|
|
|
} |
|
|
|
} |
|
|
|
// 将输入的值扩大100倍存入数据库
|
|
|
|
Double oldInventory = ObjectFormatUtil.toDouble(map.get("oldInventory")); |
|
|
|
Double newInventory = ObjectFormatUtil.toDouble(map.get("newInventory")); |
|
|
|
Double inventory = ObjectFormatUtil.toDouble(map.get("inventory")); |
|
|
|
map.put("oldInventory", (int) (oldInventory * 100)); |
|
|
|
map.put("newInventory", (int) (newInventory * 100)); |
|
|
|
map.put("inventory", (int) (inventory * 100)); |
|
|
|
|
|
|
|
return stockTakingMapper.insertStockTakingChild(map); |
|
|
|
} |
|
|
|
|
|
|
|
@ -184,14 +192,14 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
String takingResult = (String) redisTemplate.opsForHash().get(key, "takingResult"); |
|
|
|
Object number = redisTemplate.opsForHash().get(key, "number"); |
|
|
|
Object oldInventory = redisTemplate.opsForHash().get(key, "oldInventory"); |
|
|
|
Integer newInventory = ObjectFormatUtil.toInteger(oldInventory); |
|
|
|
Double newInventory = ObjectFormatUtil.toDouble(oldInventory); |
|
|
|
if ("Inventory_down".equals(takingResult)) { |
|
|
|
// 如果盘亏
|
|
|
|
newInventory -= ObjectFormatUtil.toInteger(number); |
|
|
|
newInventory -= ObjectFormatUtil.toDouble(number); |
|
|
|
|
|
|
|
} else if ("Inventory_up".equals(takingResult)) { |
|
|
|
// 如果盘盈
|
|
|
|
newInventory += ObjectFormatUtil.toInteger(number); |
|
|
|
newInventory += ObjectFormatUtil.toDouble(number); |
|
|
|
} |
|
|
|
param.put("newInventory", newInventory); |
|
|
|
param.put("depositoryId", mpv.getDepository_id().toString()); |
|
|
|
@ -239,7 +247,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
* @return 我的任务 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<SimpleStockTakingP> findMyTask(Map<String, Object> map,UserByPort userToken) { |
|
|
|
public List<SimpleStockTakingP> findMyTask(Map<String, Object> map, UserByPort userToken) { |
|
|
|
Integer size = 10, page = 1; |
|
|
|
if (map.containsKey("size")) { |
|
|
|
size = ObjectFormatUtil.toInteger(map.get("size")); |
|
|
|
@ -346,22 +354,24 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<StockTakingChildP> findStockTakingChildPByMainId(Integer mainId) { |
|
|
|
List<StockTakingChildP> stockTakingChildPS = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
for (StockTakingChildP stockTakingChildP : stockTakingChildPS) { |
|
|
|
if ("Inventory_up".equals(stockTakingChildP.getTakingResult())) { |
|
|
|
stockTakingChildP.setTakingResultShow("盘盈"); |
|
|
|
} else if ("Inventory_down".equals(stockTakingChildP.getTakingResult())) { |
|
|
|
stockTakingChildP.setTakingResultShow("盘亏"); |
|
|
|
List<StockTakingChild> stockTakingChildS = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
List<StockTakingChildP> stockTakingChildPS = new ArrayList<>(); |
|
|
|
for (StockTakingChild stockTakingChild : stockTakingChildS) { |
|
|
|
if ("Inventory_up".equals(stockTakingChild.getTakingResult())) { |
|
|
|
stockTakingChild.setTakingResultShow("盘盈"); |
|
|
|
} else if ("Inventory_down".equals(stockTakingChild.getTakingResult())) { |
|
|
|
stockTakingChild.setTakingResultShow("盘亏"); |
|
|
|
} else { |
|
|
|
stockTakingChildP.setTakingResultShow("正常"); |
|
|
|
stockTakingChild.setTakingResultShow("正常"); |
|
|
|
} |
|
|
|
stockTakingChildP.setShowUnit(stockTakingChildP.getUnit()); |
|
|
|
if ("-1".equals(stockTakingChildP.getShowUnit())) { |
|
|
|
Inventory inventoryById = materialMapper.findInventoryById(stockTakingChildP.getMid()); |
|
|
|
stockTakingChildP.setShowUnit(inventoryById.getUnit()); |
|
|
|
stockTakingChild.setShowUnit(stockTakingChild.getUnit()); |
|
|
|
if ("-1".equals(stockTakingChild.getShowUnit())) { |
|
|
|
Inventory inventoryById = materialMapper.findInventoryById(stockTakingChild.getMid()); |
|
|
|
stockTakingChild.setShowUnit(inventoryById.getUnit()); |
|
|
|
} |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByMcode = materialMapper.findMaterialByBarCodeByMcode(stockTakingChildP.getMcode()); |
|
|
|
stockTakingChildP.setMaterialAndBarCodeList(materialByBarCodeByMcode); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByMcode = materialMapper.findMaterialByBarCodeByMcode(stockTakingChild.getMcode()); |
|
|
|
stockTakingChild.setMaterialAndBarCodeList(materialByBarCodeByMcode); |
|
|
|
stockTakingChildPS.add(new StockTakingChildP(stockTakingChild)); |
|
|
|
} |
|
|
|
return stockTakingChildPS; |
|
|
|
} |
|
|
|
@ -374,7 +384,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public StockTakingChildP findStockTakingChildPById(Integer id) { |
|
|
|
return stockTakingMapper.selectStockTakingChildPById(id); |
|
|
|
return new StockTakingChildP(stockTakingMapper.selectStockTakingChildPById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -430,7 +440,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
UserByPort userByPort = PortConfig.findUserByPortByNumber(s); |
|
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
|
if(workwechat == null || "".equals(workwechat)){ |
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
workwechat = userByPort.getWechat(); |
|
|
|
} |
|
|
|
QyWxUid.append(workwechat).append(","); |
|
|
|
@ -452,8 +462,8 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
Integer depositoryId = mainRecord.getDepositoryId(); |
|
|
|
|
|
|
|
// 获取所有子单
|
|
|
|
List<StockTakingChildP> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
for (StockTakingChildP minRecord : minRecordList) { |
|
|
|
List<StockTakingChild> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
for (StockTakingChild minRecord : minRecordList) { |
|
|
|
// 获取子单详情
|
|
|
|
// 获取盘点的物料详情
|
|
|
|
|
|
|
|
@ -469,7 +479,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
|
|
|
|
// 获取盈亏数量
|
|
|
|
Integer inventory = minRecord.getInventory(); |
|
|
|
double inventory = minRecord.getInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
Inventory inventoryById = materialMapper.findInventoryById(minRecord.getMid()); |
|
|
|
@ -484,12 +494,12 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 根据盘点结果重新计算物料的单价
|
|
|
|
|
|
|
|
|
|
|
|
Integer newInventory = minRecord.getNewInventory(); |
|
|
|
double newInventory = minRecord.getNewInventory() / 100.0; |
|
|
|
|
|
|
|
// 获取当前库位上物料数量
|
|
|
|
int oldQuantity = inventoryById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity(); |
|
|
|
|
|
|
|
inventoryById.setQuantity(oldQuantity + newInventory * 100); |
|
|
|
inventoryById.setQuantity(oldQuantity + (int) (newInventory * 100)); |
|
|
|
|
|
|
|
|
|
|
|
// 用于计算新的库位数量
|
|
|
|
@ -500,7 +510,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果盘盈
|
|
|
|
|
|
|
|
// 更新当前库位数量
|
|
|
|
newNumberForPlace = placeById.getQuantity() + inventory * 100; |
|
|
|
newNumberForPlace = placeById.getQuantity() + (int) (inventory * 100); |
|
|
|
|
|
|
|
if (newNumberForPlace < placeById.getMax()) { |
|
|
|
|
|
|
|
@ -516,14 +526,14 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + inventory * 100; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int) (inventory * 100); |
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 如果盘亏
|
|
|
|
newNumberForPlace = placeById.getQuantity() - inventory * 100; |
|
|
|
newNumberForPlace = placeById.getQuantity() - (int) (inventory * 100); |
|
|
|
|
|
|
|
if (newNumberForPlace > placeById.getMin()) { |
|
|
|
//如果更新后的库位数量没有下溢
|
|
|
|
@ -532,7 +542,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
placeById.setQuantity(newNumberForPlace); |
|
|
|
|
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - inventory * 100; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int) (inventory * 100); |
|
|
|
|
|
|
|
} else { |
|
|
|
placeById.setQuantity(0); |
|
|
|
@ -623,7 +633,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
UserByPort userByPort = PortConfig.findUserByPortByNumber(s); |
|
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
|
if(workwechat == null || "".equals(workwechat)){ |
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
workwechat = userByPort.getWechat(); |
|
|
|
} |
|
|
|
QyWxUid.append(workwechat).append(","); |
|
|
|
@ -675,7 +685,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
UserByPort userByPort = PortConfig.findUserByPortByNumber(s); |
|
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
|
if(workwechat == null || "".equals(workwechat)){ |
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
workwechat = userByPort.getWechat(); |
|
|
|
} |
|
|
|
QyWxUid.append(workwechat).append(","); |
|
|
|
@ -689,9 +699,9 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
List<String> err = new ArrayList<>(); |
|
|
|
|
|
|
|
// 获取所有子单
|
|
|
|
List<StockTakingChildP> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
List<StockTakingChild> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
// 遍历当前拆单的子单详情
|
|
|
|
for (StockTakingChildP minRecord : minRecordList) { |
|
|
|
for (StockTakingChild minRecord : minRecordList) { |
|
|
|
|
|
|
|
|
|
|
|
// 获取子单详情
|
|
|
|
@ -727,7 +737,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
|
|
|
|
// 获取盈亏数量
|
|
|
|
Integer inventory = minRecord.getInventory(); |
|
|
|
double inventory = minRecord.getInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
// 获取判断对应的生产日期
|
|
|
|
@ -735,7 +745,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
|
|
|
|
// 当前盘点数目
|
|
|
|
Integer newInventory = minRecord.getNewInventory(); |
|
|
|
double newInventory = minRecord.getNewInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
if (producedDate != null) { |
|
|
|
@ -752,24 +762,24 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果当前盘点数量大于库存数量
|
|
|
|
|
|
|
|
// 修改当前库存
|
|
|
|
materialAndProducedDate.setInventory(newInventory * 100); |
|
|
|
materialAndProducedDate.setInventory((int)(newInventory * 100)); |
|
|
|
// 修改使用数量
|
|
|
|
materialAndProducedDate.setExpendnum(materialAndProducedDate.getQuantity() - newInventory * 100); |
|
|
|
materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); |
|
|
|
|
|
|
|
// 修改物料对应数量
|
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100); |
|
|
|
inventoryById.setQuantity((int)(inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100)); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
// 如果当前盘点数量小于库存数量
|
|
|
|
|
|
|
|
// 修改当前库存
|
|
|
|
materialAndProducedDate.setInventory(newInventory * 100); |
|
|
|
materialAndProducedDate.setInventory((int)(newInventory * 100)); |
|
|
|
// 修改使用数量
|
|
|
|
materialAndProducedDate.setExpendnum(materialAndProducedDate.getQuantity() - newInventory * 100); |
|
|
|
materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); |
|
|
|
|
|
|
|
// 修改物料对应数量
|
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100); |
|
|
|
inventoryById.setQuantity((int)(inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100)); |
|
|
|
} |
|
|
|
|
|
|
|
materialMapper.updateMaterialAndProducedDate(materialAndProducedDate); |
|
|
|
@ -787,7 +797,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { |
|
|
|
|
|
|
|
// 更新当前库位数量
|
|
|
|
newNumberForPlace = placeById.getQuantity() + inventory * 100; |
|
|
|
newNumberForPlace = placeById.getQuantity() +(int)( inventory * 100); |
|
|
|
|
|
|
|
if (newNumberForPlace <= placeById.getMax()) { |
|
|
|
// 如果更新后的库位数量没有上溢
|
|
|
|
@ -801,9 +811,9 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
continue; |
|
|
|
} |
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() + inventory * 100); |
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() +(int)( inventory * 100)); |
|
|
|
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + inventory * 100; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() +(int)( inventory * 100); |
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); |
|
|
|
|
|
|
|
@ -833,7 +843,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
int disposeQuantity = (int) (Math.round(Math.floor((double) inventory / scale))); |
|
|
|
|
|
|
|
// 计算要进的数目
|
|
|
|
int quantity_in = (int)(realQuantity / (scale)); |
|
|
|
int quantity_in = (int) (realQuantity / (scale)); |
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
|
|
|
|
@ -885,7 +895,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { |
|
|
|
// 如果盘点的是基础单位
|
|
|
|
|
|
|
|
newNumberForPlace = placeById.getQuantity() - inventory * 100; |
|
|
|
newNumberForPlace = placeById.getQuantity() - (int)(inventory * 100); |
|
|
|
|
|
|
|
if (newNumberForPlace > placeById.getMin()) { |
|
|
|
//如果更新后的库位数量没有下溢
|
|
|
|
@ -894,19 +904,18 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
placeById.setQuantity(newNumberForPlace); |
|
|
|
|
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - inventory * 100; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int)(inventory * 100); |
|
|
|
|
|
|
|
} else { |
|
|
|
placeById.setQuantity(0); |
|
|
|
newNumberForMatrialAndPlace = 0; |
|
|
|
} |
|
|
|
|
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() - inventory * 100); |
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() - (int)(inventory * 100)); |
|
|
|
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); |
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果是拆单单位
|
|
|
|
// 用于查找对应的拆单记录
|
|
|
|
Map<String, Object> paramForSplitInfo = new HashMap<>(); |
|
|
|
@ -924,7 +933,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果单纯的拆单库存满足数量
|
|
|
|
|
|
|
|
// 设置当前拆单库存的数量
|
|
|
|
splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - inventory * 100); |
|
|
|
splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - (int)(inventory * 100)); |
|
|
|
// 修改拆单库存
|
|
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
} else { |
|
|
|
@ -981,8 +990,8 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
|
|
|
|
// 设置剩余拆单库存处理数量
|
|
|
|
splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - inventory * 100); |
|
|
|
splitInventory.setOutQuantity(splitInventory.getOutQuantity() + inventory * 100); |
|
|
|
splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - (int)(inventory * 100)); |
|
|
|
splitInventory.setOutQuantity(splitInventory.getOutQuantity() + (int)(inventory * 100)); |
|
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
} |
|
|
|
} else { |
|
|
|
@ -1027,8 +1036,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果盘点后的库存数非法
|
|
|
|
|
|
|
|
placeById.setQuantity(placeById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity()); |
|
|
|
@ -1067,7 +1075,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
int residue = (int) (Math.ceil(inventory / (double) scale)); |
|
|
|
|
|
|
|
// 获取剩余数目
|
|
|
|
int residue_realQuantity = residue * scale - inventory; |
|
|
|
int residue_realQuantity = residue * scale - (int)(inventory); |
|
|
|
|
|
|
|
|
|
|
|
// 更新库存数量
|
|
|
|
@ -1209,9 +1217,9 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
Depository depositoryById = depositoryMapper.findDepositoryById(depositoryId); |
|
|
|
|
|
|
|
// 获取所有子单
|
|
|
|
List<StockTakingChildP> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
List<StockTakingChild> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
// 遍历当前拆单的子单详情
|
|
|
|
for (StockTakingChildP minRecord : minRecordList) { |
|
|
|
for (StockTakingChild minRecord : minRecordList) { |
|
|
|
|
|
|
|
|
|
|
|
// 获取子单详情
|
|
|
|
@ -1247,7 +1255,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
|
|
|
|
// 获取盈亏数量
|
|
|
|
Integer inventory = minRecord.getInventory(); |
|
|
|
double inventory = minRecord.getInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
// 获取判断对应的生产日期
|
|
|
|
@ -1255,7 +1263,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
|
|
|
|
// 当前盘点数目
|
|
|
|
Integer newInventory = minRecord.getNewInventory(); |
|
|
|
double newInventory = minRecord.getNewInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
if (producedDate != null) { |
|
|
|
@ -1272,24 +1280,24 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果当前盘点数量大于库存数量
|
|
|
|
|
|
|
|
// 修改当前库存
|
|
|
|
materialAndProducedDate.setInventory(newInventory * 100); |
|
|
|
materialAndProducedDate.setInventory((int)(newInventory * 100)); |
|
|
|
// 修改使用数量
|
|
|
|
materialAndProducedDate.setExpendnum(materialAndProducedDate.getQuantity() - newInventory * 100); |
|
|
|
materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); |
|
|
|
|
|
|
|
// 修改物料对应数量
|
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100); |
|
|
|
inventoryById.setQuantity((int)(inventoryById.getQuantity() + newInventory * 100 - oldInventory * 100)); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
// 如果当前盘点数量小于库存数量
|
|
|
|
|
|
|
|
// 修改当前库存
|
|
|
|
materialAndProducedDate.setInventory(newInventory * 100); |
|
|
|
materialAndProducedDate.setInventory((int)(newInventory * 100)); |
|
|
|
// 修改使用数量
|
|
|
|
materialAndProducedDate.setExpendnum(materialAndProducedDate.getQuantity() - newInventory * 100); |
|
|
|
materialAndProducedDate.setExpendnum((int)(materialAndProducedDate.getQuantity() - newInventory * 100)); |
|
|
|
|
|
|
|
// 修改物料对应数量
|
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100); |
|
|
|
inventoryById.setQuantity((int)(inventoryById.getQuantity() - oldInventory * 100 + newInventory * 100)); |
|
|
|
} |
|
|
|
|
|
|
|
materialMapper.updateMaterialAndProducedDate(materialAndProducedDate); |
|
|
|
@ -1307,7 +1315,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { |
|
|
|
|
|
|
|
// 更新当前库位数量
|
|
|
|
newNumberForPlace = placeById.getQuantity() + inventory * 100; |
|
|
|
newNumberForPlace = placeById.getQuantity() +(int)( inventory * 100); |
|
|
|
|
|
|
|
if (newNumberForPlace <= placeById.getMax()) { |
|
|
|
// 如果更新后的库位数量没有上溢
|
|
|
|
@ -1321,9 +1329,9 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
continue; |
|
|
|
} |
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() + inventory * 100); |
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() +(int)( inventory * 100)); |
|
|
|
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + inventory * 100; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() +(int)( inventory * 100); |
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); |
|
|
|
|
|
|
|
@ -1353,7 +1361,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
int disposeQuantity = (int) (Math.round(Math.floor((double) inventory / scale))); |
|
|
|
|
|
|
|
// 计算要进的数目
|
|
|
|
int quantity_in = (int)(realQuantity / (scale)); |
|
|
|
int quantity_in = (int) (realQuantity / (scale)); |
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
|
|
|
|
@ -1405,7 +1413,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
if ("-1".equals(unit) || inventoryById.getUnit().equals(minRecord.getUnit())) { |
|
|
|
// 如果盘点的是基础单位
|
|
|
|
|
|
|
|
newNumberForPlace = placeById.getQuantity() - inventory * 100; |
|
|
|
newNumberForPlace = placeById.getQuantity() - (int)(inventory * 100); |
|
|
|
|
|
|
|
if (newNumberForPlace > placeById.getMin()) { |
|
|
|
//如果更新后的库位数量没有下溢
|
|
|
|
@ -1414,14 +1422,14 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
placeById.setQuantity(newNumberForPlace); |
|
|
|
|
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - inventory * 100; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int)(inventory * 100); |
|
|
|
|
|
|
|
} else { |
|
|
|
placeById.setQuantity(0); |
|
|
|
newNumberForMatrialAndPlace = 0; |
|
|
|
} |
|
|
|
|
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() - inventory * 100); |
|
|
|
inventoryById.setQuantity(inventoryById.getQuantity() - (int)(inventory * 100)); |
|
|
|
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); |
|
|
|
|
|
|
|
@ -1443,7 +1451,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果单纯的拆单库存满足数量
|
|
|
|
|
|
|
|
// 设置当前拆单库存的数量
|
|
|
|
splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - inventory * 100); |
|
|
|
splitInventory.setSaveQuantity(splitInventory.getSaveQuantity() - (int)(inventory * 100)); |
|
|
|
// 修改拆单库存
|
|
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
} else { |
|
|
|
@ -1500,8 +1508,8 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
|
|
|
|
// 设置剩余拆单库存处理数量
|
|
|
|
splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - inventory * 100); |
|
|
|
splitInventory.setOutQuantity(splitInventory.getOutQuantity() + inventory * 100); |
|
|
|
splitInventory.setSaveQuantity(splitInfo.getQuantity() + splitInventory.getSaveQuantity() - (int)(inventory * 100)); |
|
|
|
splitInventory.setOutQuantity(splitInventory.getOutQuantity() + (int)(inventory * 100)); |
|
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
} |
|
|
|
} else { |
|
|
|
@ -1532,7 +1540,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
|
|
|
|
// 修改当前库位存放物料的数量
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(placeAndMaterialByMidAndPid.getQuantity() - (int)( surplus_redundant * 100)); |
|
|
|
placeAndMaterialByMidAndPid.setQuantity(placeAndMaterialByMidAndPid.getQuantity() - (int) (surplus_redundant * 100)); |
|
|
|
|
|
|
|
|
|
|
|
placeById.setQuantity(placeById.getQuantity() - (int) (surplus_redundant * 100)); |
|
|
|
@ -1582,10 +1590,10 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|
|
|
|
|
// 获取当前盘点对应基础单位的数量
|
|
|
|
int residue = (int)( Math.ceil(inventory / (double) scale)); |
|
|
|
int residue = (int) (Math.ceil(inventory / (double) scale)); |
|
|
|
|
|
|
|
// 获取剩余数目
|
|
|
|
int residue_realQuantity = residue * scale - inventory; |
|
|
|
int residue_realQuantity = residue * scale - (int)(inventory); |
|
|
|
|
|
|
|
|
|
|
|
// 更新库存数量
|
|
|
|
@ -1676,7 +1684,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
UserByPort userByPort1 = PortConfig.findUserByPortByNumber(s); |
|
|
|
String workwechat = userByPort1.getWorkwechat(); |
|
|
|
if(workwechat == null || "".equals(workwechat)){ |
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
workwechat = userByPort1.getWechat(); |
|
|
|
} |
|
|
|
QyWxUid.append(workwechat).append(","); |
|
|
|
@ -1744,7 +1752,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
UserByPort userByPort = PortConfig.findUserByPortByNumber(s); |
|
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
|
if(workwechat == null || "".equals(workwechat)){ |
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
workwechat = userByPort.getWechat(); |
|
|
|
} |
|
|
|
QyWxUid.append(workwechat).append(","); |
|
|
|
@ -1768,8 +1776,8 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
Integer depositoryId = mainRecord.getDepositoryId(); |
|
|
|
|
|
|
|
// 获取所有子单
|
|
|
|
List<StockTakingChildP> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(ObjectFormatUtil.toInteger(mainId)); |
|
|
|
for (StockTakingChildP minRecord : minRecordList) { |
|
|
|
List<StockTakingChild> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(ObjectFormatUtil.toInteger(mainId)); |
|
|
|
for (StockTakingChild minRecord : minRecordList) { |
|
|
|
// 获取子单详情
|
|
|
|
Integer placeId = minRecord.getPid(); |
|
|
|
// 获取库位详情
|
|
|
|
@ -1786,7 +1794,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
|
|
|
|
// 获取盈亏数量
|
|
|
|
Integer inventory = minRecord.getInventory(); |
|
|
|
double inventory = minRecord.getInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
Inventory inventoryById = materialMapper.findInventoryById(minRecord.getMid()); |
|
|
|
@ -1800,23 +1808,23 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 根据盘点结果重新计算物料的单价
|
|
|
|
|
|
|
|
|
|
|
|
Integer newInventory = minRecord.getNewInventory(); |
|
|
|
double newInventory = minRecord.getNewInventory() / 100.0; |
|
|
|
|
|
|
|
// 获取当前库位上物料数量
|
|
|
|
Integer oldQuantity = inventoryById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity(); |
|
|
|
int oldQuantity = inventoryById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity(); |
|
|
|
|
|
|
|
inventoryById.setQuantity(oldQuantity + newInventory); |
|
|
|
inventoryById.setQuantity(oldQuantity + (int)(newInventory * 100)); |
|
|
|
|
|
|
|
|
|
|
|
// 用于计算新的库位数量
|
|
|
|
Integer newNumberForPlace = 0; |
|
|
|
int newNumberForPlace = 0; |
|
|
|
// 用于计算新的库位与物料对应关系的数量
|
|
|
|
Integer newNumberForMatrialAndPlace = 0; |
|
|
|
int newNumberForMatrialAndPlace = 0; |
|
|
|
if ("Inventory_up".equals(takingResult)) { |
|
|
|
// 如果盘盈
|
|
|
|
|
|
|
|
// 更新当前库位数量
|
|
|
|
newNumberForPlace = placeById.getQuantity() + inventory; |
|
|
|
newNumberForPlace = placeById.getQuantity() +(int)( inventory * 100); |
|
|
|
|
|
|
|
if (newNumberForPlace < placeById.getMax()) { |
|
|
|
|
|
|
|
@ -1832,14 +1840,14 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + inventory; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int)(inventory*100); |
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 如果盘亏
|
|
|
|
newNumberForPlace = placeById.getQuantity() - inventory; |
|
|
|
newNumberForPlace = placeById.getQuantity() - (int)(inventory*100); |
|
|
|
|
|
|
|
if (newNumberForPlace > placeById.getMin()) { |
|
|
|
//如果更新后的库位数量没有下溢
|
|
|
|
@ -1848,7 +1856,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
placeById.setQuantity(newNumberForPlace); |
|
|
|
|
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - inventory; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - (int)(inventory*100); |
|
|
|
|
|
|
|
} else { |
|
|
|
placeById.setQuantity(0); |
|
|
|
@ -1958,7 +1966,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
for (Integer minId : minIds) { |
|
|
|
|
|
|
|
// 获取对应子订单
|
|
|
|
StockTakingChildP minRecord = stockTakingMapper.selectStockTakingChildPById(minId); |
|
|
|
StockTakingChild minRecord = stockTakingMapper.selectStockTakingChildPById(minId); |
|
|
|
|
|
|
|
|
|
|
|
// 获取当前物料库存记录
|
|
|
|
@ -2007,7 +2015,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
if (Integer.compare(newPlace.getDid(), oldPlace.getDid()) != 0) { |
|
|
|
// 转移前后不在同一仓库
|
|
|
|
|
|
|
|
inventoryById.setQuantity((int)( newInventory * 100)); |
|
|
|
inventoryById.setQuantity((int) (newInventory * 100)); |
|
|
|
|
|
|
|
// 用于获取转移后仓库的物料信息
|
|
|
|
Map<String, Object> paramForMaterialToDepository = new HashMap<>(); |
|
|
|
@ -2036,7 +2044,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
if (newPlaceAndMaterial == null) { |
|
|
|
// 如果转移之后的库位没有该物料
|
|
|
|
paramForMaterialAndPlace.put("quantity", (int)(inventory_transfer * 100)); |
|
|
|
paramForMaterialAndPlace.put("quantity", (int) (inventory_transfer * 100)); |
|
|
|
// 添加物料记录
|
|
|
|
placeMapper.addMaterialOnPlace(paramForMaterialAndPlace); |
|
|
|
} else { |
|
|
|
@ -2079,8 +2087,8 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
// 最终存储到拆单处理的数量
|
|
|
|
double saveQuantity = inventory_transfer - disposeQuantity * splitInfo.getQuantity(); |
|
|
|
insertForSplitInventory.put("saveQuantity",(int) (saveQuantity * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity",(int) (saveQuantity * 100)); |
|
|
|
insertForSplitInventory.put("saveQuantity", (int) (saveQuantity * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity", (int) (saveQuantity * 100)); |
|
|
|
// 添加一条拆单库存记录
|
|
|
|
res += splitUnitMapper.addSplitInventory(insertForSplitInventory); |
|
|
|
|
|
|
|
@ -2110,8 +2118,8 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果不大于
|
|
|
|
|
|
|
|
|
|
|
|
insertForSplitInventory.put("saveQuantity", (int)(inventory_transfer * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity", (int)(inventory_transfer * 100)); |
|
|
|
insertForSplitInventory.put("saveQuantity", (int) (inventory_transfer * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity", (int) (inventory_transfer * 100)); |
|
|
|
// 添加一条拆单库存记录
|
|
|
|
res += splitUnitMapper.addSplitInventory(insertForSplitInventory); |
|
|
|
|
|
|
|
@ -2155,7 +2163,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
flag = true; |
|
|
|
|
|
|
|
// 计算要进制的数目
|
|
|
|
int quantity_in = (int)(realQuantity / scale); |
|
|
|
int quantity_in = (int) (realQuantity / scale); |
|
|
|
|
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
@ -2217,15 +2225,15 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果当前处理的数量大于进制数
|
|
|
|
|
|
|
|
// 计算要进的数目
|
|
|
|
int quantity_in = (int)(inventory_transfer / scale); |
|
|
|
int quantity_in = (int) (inventory_transfer / scale); |
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
// 拆单库存实际入库的数量
|
|
|
|
realQuantity = realQuantity - quantity_in * scale; |
|
|
|
|
|
|
|
|
|
|
|
insertForSplitInventory.put("saveQuantity", (int)(realQuantity * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity", (int)(realQuantity * 100)); |
|
|
|
insertForSplitInventory.put("saveQuantity", (int) (realQuantity * 100)); |
|
|
|
insertForSplitInventory.put("inQuantity", (int) (realQuantity * 100)); |
|
|
|
|
|
|
|
splitUnitMapper.addSplitInventory(insertForSplitInventory); |
|
|
|
|
|
|
|
@ -2351,7 +2359,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果当前处理的数量大于进制数
|
|
|
|
|
|
|
|
// 计算要进的数目
|
|
|
|
int quantity_in = (int)(inventory_transfer / scale); |
|
|
|
int quantity_in = (int) (inventory_transfer / scale); |
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
// 拆单库存实际入库的数量
|
|
|
|
@ -2544,7 +2552,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
flag = true; |
|
|
|
|
|
|
|
// 计算要进制的数目
|
|
|
|
int quantity_in = (int)(realQuantity / scale); |
|
|
|
int quantity_in = (int) (realQuantity / scale); |
|
|
|
|
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
@ -2606,7 +2614,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 如果当前处理的数量大于进制数
|
|
|
|
|
|
|
|
// 计算要进的数目
|
|
|
|
int quantity_in = (int)(inventory_transfer / scale); |
|
|
|
int quantity_in = (int) (inventory_transfer / scale); |
|
|
|
// 更新处理数量
|
|
|
|
disposeQuantity += quantity_in; |
|
|
|
// 拆单库存实际入库的数量
|
|
|
|
@ -2755,7 +2763,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
StringBuilder departMentHeadQyWxName = new StringBuilder(); |
|
|
|
UserByPort userByPort = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(originator), userToken); |
|
|
|
String workwechat = userByPort.getWorkwechat(); |
|
|
|
if(workwechat == null || "".equals(workwechat)){ |
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
workwechat = userByPort.getWechat(); |
|
|
|
} |
|
|
|
// departMentHeadQyWxName.append(workwechat+",");
|
|
|
|
@ -2812,11 +2820,11 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
|
|
|
|
// 用于标识是否向盘点人员发送卡片
|
|
|
|
Boolean flag = true; |
|
|
|
boolean flag = true; |
|
|
|
|
|
|
|
// 获取主单
|
|
|
|
StockTaking mainRecord = stockTakingMapper.selectStockTakingById(mainId); |
|
|
|
Integer departmentManagerState = 2; |
|
|
|
int departmentManagerState = 2; |
|
|
|
|
|
|
|
// 获取当前处理时间
|
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
@ -2833,11 +2841,9 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有子单
|
|
|
|
List<StockTakingChildP> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
for (int i = 0; i < minRecordList.size(); i++) { |
|
|
|
List<StockTakingChild> minRecordList = stockTakingMapper.selectStockTakingChildByMainId(mainId); |
|
|
|
for (StockTakingChild minRecord : minRecordList) { |
|
|
|
// 获取子单详情
|
|
|
|
StockTakingChildP minRecord = minRecordList.get(i); |
|
|
|
|
|
|
|
Integer placeId = minRecord.getPid(); |
|
|
|
// 获取库位详情
|
|
|
|
Place placeById = placeMapper.findPlaceById(placeId); |
|
|
|
@ -2850,7 +2856,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
} |
|
|
|
|
|
|
|
// 获取盈亏数量
|
|
|
|
Integer inventory = minRecord.getInventory(); |
|
|
|
double inventory = minRecord.getInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
Material materialById = materialMapper.findMaterialById(minRecord.getMid()); |
|
|
|
@ -2864,24 +2870,24 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
// 根据盘点结果重新计算物料的单价
|
|
|
|
|
|
|
|
|
|
|
|
Integer newInventory = minRecord.getNewInventory(); |
|
|
|
double newInventory = minRecord.getNewInventory() / 100.0; |
|
|
|
|
|
|
|
|
|
|
|
// 获取当前库位上物料数量
|
|
|
|
Integer oldQuantity = materialById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity(); |
|
|
|
int oldQuantity = materialById.getQuantity() - placeAndMaterialByMidAndPid.getQuantity(); |
|
|
|
|
|
|
|
materialById.setQuantity(oldQuantity + newInventory); |
|
|
|
materialById.setQuantity(oldQuantity + (int)(newInventory*100)); |
|
|
|
|
|
|
|
|
|
|
|
// 用于计算新的库位数量
|
|
|
|
Integer newNumberForPlace = 0; |
|
|
|
int newNumberForPlace = 0; |
|
|
|
// 用于计算新的库位与物料对应关系的数量
|
|
|
|
Integer newNumberForMatrialAndPlace = 0; |
|
|
|
int newNumberForMatrialAndPlace = 0; |
|
|
|
if ("Inventory_up".equals(takingResult)) { |
|
|
|
// 如果盘盈
|
|
|
|
|
|
|
|
// 更新当前库位数量
|
|
|
|
newNumberForPlace = placeById.getQuantity() + inventory; |
|
|
|
newNumberForPlace = placeById.getQuantity() +(int)(inventory*100); |
|
|
|
|
|
|
|
if (newNumberForPlace < placeById.getMax()) { |
|
|
|
|
|
|
|
@ -2897,14 +2903,14 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + inventory; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() + (int)(inventory*100); |
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
placeAndMaterialByMidAndPid.setQuantity(newNumberForMatrialAndPlace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 如果盘亏
|
|
|
|
newNumberForPlace = placeById.getQuantity() - inventory; |
|
|
|
newNumberForPlace = placeById.getQuantity() - (int)(inventory*100); |
|
|
|
|
|
|
|
if (newNumberForPlace > placeById.getMin()) { |
|
|
|
//如果更新后的库位数量没有下溢
|
|
|
|
@ -2913,7 +2919,7 @@ public class StockTakingServiceImpl implements StockTakingService { |
|
|
|
placeById.setQuantity(newNumberForPlace); |
|
|
|
|
|
|
|
// 更新物料与库位对应关系的数量
|
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() - inventory; |
|
|
|
newNumberForMatrialAndPlace = placeAndMaterialByMidAndPid.getQuantity() -(int)( inventory*100); |
|
|
|
|
|
|
|
} else { |
|
|
|
placeById.setQuantity(0); |
|
|
|
|