Authored by LUOXC

add log

@@ -4,10 +4,12 @@ import com.yoho.order.dal.ProductSizeMapper; @@ -4,10 +4,12 @@ import com.yoho.order.dal.ProductSizeMapper;
4 import com.yoho.order.model.ProductSize; 4 import com.yoho.order.model.ProductSize;
5 import com.yoho.ufo.dal.UfoSizeMapper; 5 import com.yoho.ufo.dal.UfoSizeMapper;
6 import com.yoho.ufo.model.commoditybasicrole.size.Size; 6 import com.yoho.ufo.model.commoditybasicrole.size.Size;
  7 +import lombok.extern.slf4j.Slf4j;
7 import org.apache.ibatis.annotations.Param; 8 import org.apache.ibatis.annotations.Param;
8 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
10 11
  12 +@Slf4j
11 @Service 13 @Service
12 public class SizeManage { 14 public class SizeManage {
13 15
@@ -26,7 +28,9 @@ public class SizeManage { @@ -26,7 +28,9 @@ public class SizeManage {
26 public int insertSize(Size size) { 28 public int insertSize(Size size) {
27 int rows = ufoSizeMapper.insertSize(size); 29 int rows = ufoSizeMapper.insertSize(size);
28 if (rows > 0) { 30 if (rows > 0) {
29 - productSizeMapper.insert(newProductSize(size)); 31 + if (productSizeMapper.insert(newProductSize(size)) == 0) {
  32 + log.warn("product size {} {} insert fail", size.getSizeId(), size.getSizeName());
  33 + }
30 } 34 }
31 return rows; 35 return rows;
32 } 36 }
@@ -40,7 +44,9 @@ public class SizeManage { @@ -40,7 +44,9 @@ public class SizeManage {
40 public int updateSize(@Param("size") Size size) { 44 public int updateSize(@Param("size") Size size) {
41 int rows = ufoSizeMapper.updateSize(size); 45 int rows = ufoSizeMapper.updateSize(size);
42 if (rows > 0) { 46 if (rows > 0) {
43 - productSizeMapper.updateBySizeId(newProductSize(size)); 47 + if (productSizeMapper.updateBySizeId(newProductSize(size)) == 0) {
  48 + log.warn("product size {} {} update fail", size.getSizeId(), size.getSizeName());
  49 + }
44 } 50 }
45 return rows; 51 return rows;
46 } 52 }