Browse Source

物料更新期初总价

guq 7 years ago
parent
commit
941613d4aa

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductDetailMapper.java

@@ -27,4 +27,6 @@ public interface ProductDetailMapper extends CommonBaseMapper<ProductDetail> {
     List<ProductDetail> selectByProdId(Long id);
 
     boolean deleteByProdId(Long id);
+
+    void updatePd_price(Long id);
 }

+ 1 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -133,6 +133,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
 
                 productDetailMapper.batchInsert(productDetailList);
             }
+            productDetailMapper.updatePd_price(product.getId());
             //生成库存初始化数据并过账
             generateProdIOPost(product, productDetailList);
 

+ 3 - 0
applications/document/document-server/src/main/resources/mapper/ProductDetailMapper.xml

@@ -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>