...
|
...
|
@@ -4,10 +4,12 @@ import com.yoho.order.dal.ProductSizeMapper; |
|
|
import com.yoho.order.model.ProductSize;
|
|
|
import com.yoho.ufo.dal.UfoSizeMapper;
|
|
|
import com.yoho.ufo.model.commoditybasicrole.size.Size;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class SizeManage {
|
|
|
|
...
|
...
|
@@ -26,7 +28,9 @@ public class SizeManage { |
|
|
public int insertSize(Size size) {
|
|
|
int rows = ufoSizeMapper.insertSize(size);
|
|
|
if (rows > 0) {
|
|
|
productSizeMapper.insert(newProductSize(size));
|
|
|
if (productSizeMapper.insert(newProductSize(size)) == 0) {
|
|
|
log.warn("product size {} {} insert fail", size.getSizeId(), size.getSizeName());
|
|
|
}
|
|
|
}
|
|
|
return rows;
|
|
|
}
|
...
|
...
|
@@ -40,7 +44,9 @@ public class SizeManage { |
|
|
public int updateSize(@Param("size") Size size) {
|
|
|
int rows = ufoSizeMapper.updateSize(size);
|
|
|
if (rows > 0) {
|
|
|
productSizeMapper.updateBySizeId(newProductSize(size));
|
|
|
if (productSizeMapper.updateBySizeId(newProductSize(size)) == 0) {
|
|
|
log.warn("product size {} {} update fail", size.getSizeId(), size.getSizeName());
|
|
|
}
|
|
|
}
|
|
|
return rows;
|
|
|
}
|
...
|
...
|
|