优化商品成本价的计算逻辑,解决计算查询的bug

This commit is contained in:
jishenghua
2025-06-30 22:08:56 +08:00
parent 30007c1c3d
commit 3b7b13eaee
2 changed files with 3 additions and 2 deletions

View File

@@ -1062,7 +1062,8 @@ public class DepotItemService {
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void updateCurrentUnitPrice(DepotItem depotItem) throws Exception { public void updateCurrentUnitPrice(DepotItem depotItem) throws Exception {
Boolean forceFlag = systemConfigService.getForceApprovalFlag(); Boolean forceFlag = systemConfigService.getForceApprovalFlag();
Boolean inOutManageFlag = systemConfigService.getInOutManageFlag(); //此处给出入库管理的传值默认为false不然会导致查询不到销售相关的单据
Boolean inOutManageFlag = false;
//查询多单位信息 //查询多单位信息
Unit unitInfo = materialService.findUnit(depotItem.getMaterialId()); Unit unitInfo = materialService.findUnit(depotItem.getMaterialId());
List<DepotItemVo4DetailByTypeAndMId> itemList = findDetailByDepotIdsAndMaterialIdList(null, forceFlag, inOutManageFlag, depotItem.getSku(), List<DepotItemVo4DetailByTypeAndMId> itemList = findDetailByDepotIdsAndMaterialIdList(null, forceFlag, inOutManageFlag, depotItem.getSku(),

View File

@@ -184,7 +184,7 @@
) )
</if> </if>
<if test="forceFlag"> <if test="forceFlag">
and dh.status = '1' and (dh.status = '1' or dh.status = '2' or dh.status = '3')
</if> </if>
<if test="sku != null and sku !=''"> <if test="sku != null and sku !=''">
and di.sku = #{sku} and di.sku = #{sku}