Browse Source

Merge remote-tracking branch 'origin/dev' into dev

赵冬冬 4 years ago
parent
commit
ab6f8f70fd

+ 8 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/ProductTypePriceMapper.java

@@ -26,6 +26,14 @@ public interface ProductTypePriceMapper extends BaseMapper<ProductTypePriceWithB
      */
      */
     int updateGoodsInfoPrice(ProductTypePriceWithBLOBs productTypePriceWithBLOBs);
     int updateGoodsInfoPrice(ProductTypePriceWithBLOBs productTypePriceWithBLOBs);
 
 
+    /**
+     * 根据定价修改商品销售表价格
+     * lym
+     * @param productTypePriceWithBLOBs
+     * @return
+     */
+    int updateGoodsSaleInfoPrice(ProductTypePriceWithBLOBs productTypePriceWithBLOBs);
+
     /**
     /**
      * 查询最新的产品类别定价
      * 查询最新的产品类别定价
      * lym
      * lym

+ 3 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/events/ProductTypePriceEvent.java

@@ -38,5 +38,8 @@ public class ProductTypePriceEvent {
         int i = productTypePriceMapper.updateGoodsInfoPrice(productTypePrice);
         int i = productTypePriceMapper.updateGoodsInfoPrice(productTypePrice);
         log.info("修改:"+productTypePrice.getTypeName()+"类别,id:{"+productTypePrice.getFkProductType()+"}共"
         log.info("修改:"+productTypePrice.getTypeName()+"类别,id:{"+productTypePrice.getFkProductType()+"}共"
                 + i +"商品定价为"+productTypePrice.getPrice());
                 + i +"商品定价为"+productTypePrice.getPrice());
+        i = productTypePriceMapper.updateGoodsSaleInfoPrice(productTypePrice);
+        log.info("修改:"+productTypePrice.getTypeName()+"类别,id:{"+productTypePrice.getFkProductType()+"}共"
+                + i +"商品销售定价为"+productTypePrice.getPrice());
     }
     }
 }
 }

+ 14 - 0
carbon-back/carbon-back-service/src/main/resources/carbon/ProductTypePriceMapper.xml

@@ -240,6 +240,20 @@
        )
        )
   </update>
   </update>
 
 
+  <!-- 根据定价修改商品销售表价格 lym -->
+  <update id="updateGoodsSaleInfoPrice" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    UPDATE t_goods_sale_info
+      SET sale_price = #{price,jdbcType=DECIMAL}
+      WHERE fk_goods_guid IN
+       ( SELECT tmp.guid FROM(SELECT a.guid,a.price,c.fk_product_type FROM t_goods_info a
+        LEFT JOIN t_goods_detail b ON a.guid = b.fk_goods_guid
+        LEFT JOIN t_product_info c ON b.fk_product_guid = c.guid
+        WHERE a.state = 1 AND b.state = 1 AND c.state = 1
+        AND  FIND_IN_SET(c.fk_product_type,#{fkProductType,jdbcType=LONGVARCHAR})
+        ) tmp
+       )
+  </update>
+
   <!-- 查询最新的产品类别定价 lym -->
   <!-- 查询最新的产品类别定价 lym -->
   <select id="selectNewProductTypePrice" parameterType="String" resultMap="ResultMapWithBLOBs">
   <select id="selectNewProductTypePrice" parameterType="String" resultMap="ResultMapWithBLOBs">
       SELECT <include refid="Base_Column_List"/>,<include refid="Blob_Column_List"/>
       SELECT <include refid="Base_Column_List"/>,<include refid="Blob_Column_List"/>

+ 3 - 0
carbon-h5/carbon-h5-service/src/main/java/com/hcloud/microserver/h5/controller/web/GoodsManageTwoController.java

@@ -53,6 +53,9 @@ public class GoodsManageTwoController extends BaseController {
     @GetMapping("/getGoodsInfoByCarbonNum")
     @GetMapping("/getGoodsInfoByCarbonNum")
     @AuthCarbonValidate
     @AuthCarbonValidate
     public ResponseBase getGoodsInfoByCarbonNum(@RequestParam("carbonNum") Integer carbonNum){
     public ResponseBase getGoodsInfoByCarbonNum(@RequestParam("carbonNum") Integer carbonNum){
+        if (carbonNum == null){
+            throw new GlobalException(ResultEnum.FAILURE.getCode(),"请输入购碳量");
+        }
         if (carbonNum > 9999999){
         if (carbonNum > 9999999){
             throw new GlobalException(ResultEnum.FAILURE.getCode(),"购碳量过大");
             throw new GlobalException(ResultEnum.FAILURE.getCode(),"购碳量过大");
         }
         }

+ 1 - 1
carbon-h5/carbon-h5-service/src/main/resources/com/hcloud/microserver/h5/dao/GoodsManageMapper.xml

@@ -46,7 +46,7 @@
         aa.goods_name AS goodsName,
         aa.goods_name AS goodsName,
         aa.goods_images AS goodsImages,
         aa.goods_images AS goodsImages,
         aa.goods_type AS goodsType,
         aa.goods_type AS goodsType,
-        aa.price,
+        bb.sale_price AS price,
         aa.goods_use AS goodsUse,
         aa.goods_use AS goodsUse,
         bb.sale_unit AS saleUnit,
         bb.sale_unit AS saleUnit,
         bb.saled_carbon_skin AS saledCarbonSkin,
         bb.saled_carbon_skin AS saledCarbonSkin,