Merge branch 'master' of https://gitee.com/hdka/FURNITURE-OA
This commit is contained in:
@@ -200,6 +200,7 @@ public class MatMaterialServiceImpl implements IMatMaterialService {
|
|||||||
QueryWrapper<MatPurchase> purchaseQw = new QueryWrapper<>();
|
QueryWrapper<MatPurchase> purchaseQw = new QueryWrapper<>();
|
||||||
purchaseQw.in("material_id", materialIds);
|
purchaseQw.in("material_id", materialIds);
|
||||||
purchaseQw.eq("del_flag", 0);
|
purchaseQw.eq("del_flag", 0);
|
||||||
|
purchaseQw.ne("status", 3); // 排除已取消的采购单
|
||||||
List<MatPurchase> purchaseListPo = matPurchaseMapper.selectList(purchaseQw);
|
List<MatPurchase> purchaseListPo = matPurchaseMapper.selectList(purchaseQw);
|
||||||
|
|
||||||
// 按materialId分组
|
// 按materialId分组
|
||||||
@@ -220,6 +221,8 @@ public class MatMaterialServiceImpl implements IMatMaterialService {
|
|||||||
if (!purchaseIds.isEmpty()) {
|
if (!purchaseIds.isEmpty()) {
|
||||||
LambdaQueryWrapper<MatPurchaseInDetail> detailLqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<MatPurchaseInDetail> detailLqw = Wrappers.lambdaQuery();
|
||||||
detailLqw.in(MatPurchaseInDetail::getPurchaseId, purchaseIds);
|
detailLqw.in(MatPurchaseInDetail::getPurchaseId, purchaseIds);
|
||||||
|
// 逻辑删除
|
||||||
|
detailLqw.eq(MatPurchaseInDetail::getDelFlag, 0);
|
||||||
List<MatPurchaseInDetail> allDetails = matPurchaseInDetailMapper.selectList(detailLqw);
|
List<MatPurchaseInDetail> allDetails = matPurchaseInDetailMapper.selectList(detailLqw);
|
||||||
detailsByPurchaseId = allDetails.stream()
|
detailsByPurchaseId = allDetails.stream()
|
||||||
.collect(Collectors.groupingBy(MatPurchaseInDetail::getPurchaseId));
|
.collect(Collectors.groupingBy(MatPurchaseInDetail::getPurchaseId));
|
||||||
|
|||||||
@@ -317,6 +317,8 @@ public class MatPurchaseInDetailServiceImpl implements IMatPurchaseInDetailServi
|
|||||||
LambdaQueryWrapper<MatPriceHistory> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<MatPriceHistory> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(MatPriceHistory::getMaterialId, materialId);
|
lqw.eq(MatPriceHistory::getMaterialId, materialId);
|
||||||
lqw.orderByDesc(MatPriceHistory::getCreateTime);
|
lqw.orderByDesc(MatPriceHistory::getCreateTime);
|
||||||
|
// 逻辑删除
|
||||||
|
lqw.eq(MatPriceHistory::getDelFlag, 0);
|
||||||
lqw.last("LIMIT 1");
|
lqw.last("LIMIT 1");
|
||||||
|
|
||||||
MatPriceHistoryVo lastHistory = matPriceHistoryMapper.selectVoOne(lqw);
|
MatPriceHistoryVo lastHistory = matPriceHistoryMapper.selectVoOne(lqw);
|
||||||
@@ -405,6 +407,7 @@ public class MatPurchaseInDetailServiceImpl implements IMatPurchaseInDetailServi
|
|||||||
LambdaQueryWrapper<MatPriceHistory> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<MatPriceHistory> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(MatPriceHistory::getMaterialId, materialId);
|
lqw.eq(MatPriceHistory::getMaterialId, materialId);
|
||||||
lqw.eq(MatPriceHistory::getPurchaseInDetailId, purchaseInDetailId);
|
lqw.eq(MatPriceHistory::getPurchaseInDetailId, purchaseInDetailId);
|
||||||
|
lqw.eq(MatPriceHistory::getDelFlag, 0);
|
||||||
|
|
||||||
// 查询待删除的记录
|
// 查询待删除的记录
|
||||||
List<MatPriceHistoryVo> historyList = matPriceHistoryMapper.selectVoList(lqw);
|
List<MatPriceHistoryVo> historyList = matPriceHistoryMapper.selectVoList(lqw);
|
||||||
|
|||||||
Reference in New Issue
Block a user