@@ -27,4 +27,6 @@ public interface ProductDetailMapper extends CommonBaseMapper<ProductDetail> {
List<ProductDetail> selectByProdId(Long id);
boolean deleteByProdId(Long id);
+
+ void updatePd_price(Long id);
}
@@ -133,6 +133,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
productDetailMapper.batchInsert(productDetailList);
+ productDetailMapper.updatePd_price(product.getId());
//生成库存初始化数据并过账
generateProdIOPost(product, productDetailList);
@@ -336,4 +336,7 @@
<delete id="deleteByProdId" >
DELETE FROM PRODUCTDETAIL WHERE PD_PRODID=#{id}
</delete>
+ <update id="updatePd_price" parameterType="long">
+ update productdetail set pd_amount=round(pd_num*pd_price,2) where pd_piid=#{id};
+ </update>
</mapper>