changhaoning пре 1 година
родитељ
комит
71539ced32

+ 2 - 1
src/main/java/com/dk/mdm/mapper/ivt/InventoryBatchMapper.xml

@@ -70,7 +70,7 @@
     <sql id="Condition">
         <where>
             <if test="invId != null and invId != ''">
-                AND inv_id = #{invId}
+                AND inv_id = #{invId}::uuid
             </if>
             <if test="fromId != null and fromId != ''">
                 AND from_id = #{fromId}
@@ -147,6 +147,7 @@
     <sql id="Join_Table">
         left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpib.sku_id
         left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpib.wh_id
+        left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
     </sql>
 
     <!-- 根据主键查询表dkic_b.t_psi_inventory_batch的一行数据 -->

+ 3 - 3
src/main/java/com/dk/mdm/service/ivt/inbound/InboundItemService.java

@@ -142,7 +142,7 @@ public class InboundItemService extends BaseService<InboundItem> {
 								.setCostAmt(outCostAmt);
 						outboundItemMapper.updateOutCost(outboundItemQuery);
 
-						outCostAmtTotal.add(outCostAmt);
+						outCostAmtTotal = outCostAmtTotal.add(outCostAmt);
 						//修改存货批次明细
 						InventoryBatchQuery inventoryBatchQuery = new InventoryBatchQuery()
 								.setBatchId(inventoryBatchResponse.getBatchId())
@@ -211,11 +211,11 @@ public class InboundItemService extends BaseService<InboundItem> {
 
 		BigDecimal inventoryCostTotal = BigDecimal.ZERO;
 		for(InventoryBatchResponse inventoryBatchResponse1 : inventoryBatchList){
-			inventoryCostTotal.add(inventoryBatchResponse1.getCostAmt());
+			inventoryCostTotal = inventoryCostTotal.add(inventoryBatchResponse1.getCostAmt());
 		}
 		Inventory inventory = new Inventory()
 				.setInvId(inventoryBatchQuery.getInvId())
-				.setCostPrice(inventoryCostTotal.divide(inventoryResponse.getInvQty()).setScale(2, BigDecimal.ROUND_HALF_UP))
+				.setCostPrice(inventoryCostTotal.divide(inventoryResponse.getInvQty(),BigDecimal.ROUND_HALF_UP))
 				.setCostAmt(inventoryCostTotal);
 		inventoryMapper.updateCost(inventory);
 		return ResponseResultUtil.success(inventoryBatchQuery);