浏览代码

simple imgUrl

梁彦春 6 年前
父节点
当前提交
254673a0a1

+ 2
- 0
src/main/java/com.huiju.welcome/controller/TaGoodsController.java 查看文件

@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
18 18
 import org.springframework.beans.factory.annotation.Autowired;
19 19
 import org.springframework.web.bind.annotation.*;
20 20
 
21
+import java.math.BigDecimal;
21 22
 import java.time.LocalDateTime;
22 23
 import java.util.List;
23 24
 
@@ -57,6 +58,7 @@ public class TaGoodsController extends BaseController {
57 58
             List<TaGoodsSpec> specList = taGoods.getSpecList();
58 59
             specList.stream().forEach(e -> {
59 60
                 e.setGoodsId(taGoods.getGoodsId());
61
+                e.setGoodsPrice(BigDecimal.valueOf(0));
60 62
             });
61 63
 
62 64
             boolean result = iTaGoodsSpecService.saveBatch(specList);

+ 4
- 0
src/main/resources/mapper/TaGoodsSpecMapper.xml 查看文件

@@ -23,4 +23,8 @@
23 23
         where a.goods_id = #{goodsId}
24 24
     </select>
25 25
 
26
+    <delete id="deleteSpecsByGoodsId">
27
+        delete from ta_goods_spec where goods_id = #{goodsId}
28
+    </delete>
29
+
26 30
 </mapper>