Procházet zdrojové kódy

pda提交订单价格bug修改

huang před 1 týdnem
rodič
revize
8e2826d7b4

+ 4 - 4
src/main/java/com/jsh/erp/service/impl/DepotHeadServiceImpl.java

@@ -2064,10 +2064,10 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             depotItemService.updateCurrentUnitPrice(depotItem);
             //修改商品生产日期
             //materialExtendService.update(new UpdateWrapper<MaterialExtend>().set("production_date",materialMap.get(batchNumber).getProductionDate()).eq("id", materialExtend.getId()));
-            //修改订单总额
-            updateTotalPriceById(depotHead);
         }
-        //修改采购订单状态、操作人、操作时间
+        //修改订单总额
+        updateTotalPriceById(depotHead);
+        //修改采购订单状态、操作人、操作时间,数额
         this.update(new UpdateWrapper<DepotHead>().set("status", "2").set("oper_id",userInfo.getId()).set("submit_time",new Date()).eq("id", pdaDepotHeadDTO.getId()));
         return true;
     }
@@ -2087,7 +2087,7 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             if (depotHead.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
                 totalPrice = totalPrice.negate();
             }
-            update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("change_amount",totalPrice).set("discount_last_money",sum).eq("id",list.get(0).getId()));
+            this.update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("change_amount",totalPrice).set("discount_last_money",sum).eq("id",depotHead.getId()));
         }
     }