|
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
|
|
|
* 待出入库 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
- * @author
|
|
|
+ * @author
|
|
|
* @since 2023-03-22
|
|
|
*/
|
|
|
@DS(SourceConstant.WMS)
|
|
@@ -59,8 +59,8 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
|
|
|
IWrapper<StockWait> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("sw", StockWait::getId);
|
|
|
//过滤入库/出库
|
|
|
- wrapper.eq(StockWait::getType,dto.getType());
|
|
|
- wrapper.eq(StockWait::getBusinessCode,dto.getKeyword());
|
|
|
+ wrapper.eq(StockWait::getType, dto.getType());
|
|
|
+ wrapper.eq(StockWait::getBusinessCode, dto.getKeyword());
|
|
|
Page<StockWaitVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
|
|
|
List<StockWaitVo> records = page.getRecords();
|
|
@@ -93,13 +93,13 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
|
|
|
//更新已入库数量
|
|
|
StockWait byId = getById(stockWaitDto.getId());
|
|
|
byId.setReceiptQuantity(byId.getReceiptQuantity().add(stockWaitDto.getQuantity()));
|
|
|
- if (byId.getReceiptQuantity().compareTo(byId.getQuantity())>0){
|
|
|
+ if (byId.getReceiptQuantity().compareTo(byId.getQuantity()) > 0) {
|
|
|
throw new ServiceException("入库数量+已入库数量不能大于待采购数量");
|
|
|
}
|
|
|
updateById(byId);
|
|
|
//创建出入库记录
|
|
|
StockJournal stockJournal = new StockJournal();
|
|
|
- stockJournal.setType(byId.getType());
|
|
|
+ stockJournal.setType(byId.getType() == 1 ? 4 : 5);
|
|
|
stockJournal.setWarehouseId(stockWaitDto.getWarehouseId());
|
|
|
stockJournal.setBusinessId(byId.getId());
|
|
|
//保存出入库记录
|