Guo1B0 1 year ago
parent
commit
b513271c60

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java

@@ -93,7 +93,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                 // 折后价格
                 discountedPrice = discountedPrice.add(price.multiply(divide));
             }
-            BigDecimal divide = discountedPrice.divide(finalPrice);
+            BigDecimal divide = discountedPrice.divide(finalPrice,2,BigDecimal.ROUND_UP);
             // 整单折扣率
             businessOpportunity.setFinalPrice(divide.multiply(new BigDecimal(100)));
         }

+ 2 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessItemProductMapper.xml

@@ -25,11 +25,11 @@
                p.price price,
                (select `name` from sys_dict where id = p.unit and code = 'ProductUnit') unit,
                (select `name` from sys_dict where id = p.type and code = 'ProductType') productType,
-               p.inventory inventory,
+               p.inventory inventory
         from business_item_product i
                  left join product p on i.product_id = p.id
 --         left join sys_dict d on
-        where business_id = #{id}
+        where i.business_id = #{id}
     </select>
 
 </mapper>