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