|
|
@@ -453,8 +453,17 @@ public class VendorListSubmitServiceImpl implements VendorListSubmitService {
|
|
|
* @param vendorListSubmit
|
|
|
* @return
|
|
|
*/
|
|
|
- private boolean validition(VendorListSubmit vendorListSubmit) {
|
|
|
- boolean tag = true;
|
|
|
- return tag;
|
|
|
+ private void validition(VendorListSubmit vendorListSubmit) {
|
|
|
+ if (vendorListSubmit.getBranduuid() == null) {
|
|
|
+ throw new IllegalOperatorException("品牌信息为空,请确认信息后重新申请");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 店铺id不为空时,验证同品牌下是否存在已关联该店铺的供应商(更新自身除外)
|
|
|
+ if (vendorListSubmit.getStoreuuid() != null) {
|
|
|
+ VendorList existsVendor = vendorListDao.findByBranduuidAndStoreuuid(vendorListSubmit.getBranduuid(), vendorListSubmit.getStoreuuid());
|
|
|
+ if (existsVendor != null && !existsVendor.getId().equals(vendorListSubmit.getVendorid())) {
|
|
|
+ throw new IllegalOperatorException("此店铺关联供应商已入驻,请确认信息后重新申请");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|