...
|
...
|
@@ -12,7 +12,9 @@ import org.springframework.web.bind.annotation.RequestParam; |
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.dal.product.ProductSelfShelvesMapper;
|
|
|
import com.yohoufo.dal.product.model.ProductSelfShelves;
|
|
|
import com.yohoufo.product.service.SelfShelvesService;
|
|
|
|
...
|
...
|
@@ -23,6 +25,8 @@ public class SelfShelvesController { |
|
|
|
|
|
@Autowired
|
|
|
private SelfShelvesService selfShelvesService;
|
|
|
@Autowired
|
|
|
private ProductSelfShelvesMapper productSelfShelvesMapper;
|
|
|
|
|
|
@RequestMapping(params = "method=ufo.selfShelves.save")
|
|
|
@ResponseBody
|
...
|
...
|
@@ -42,6 +46,12 @@ public class SelfShelvesController { |
|
|
if(null == uid || 0 == uid.intValue()) {
|
|
|
return new ApiResponse.ApiResponseBuilder().code(401).message("uid为空,请登录").build();
|
|
|
}
|
|
|
//校验货号是否已存在
|
|
|
List<ProductSelfShelves> list = productSelfShelvesMapper.selectByProductCode(productCode);
|
|
|
if(CollectionUtils.isNotEmpty(list)) {
|
|
|
return new ApiResponse.ApiResponseBuilder().code(500).message("商品货号信息已存在,您可以直接通过搜索功能查询货号找到商品后进行出售").build();
|
|
|
}
|
|
|
|
|
|
ProductSelfShelves pss = new ProductSelfShelves();
|
|
|
pss.setUid(uid);
|
|
|
pss.setBrand(brand);
|
...
|
...
|
|