|
@@ -50,6 +50,8 @@ public class SupplierServiceImpl implements SupplierService {
|
|
public int save(SupplierEntity supplier) {
|
|
public int save(SupplierEntity supplier) {
|
|
if(StringUtils.isEmpty(supplier.getLevelMerchSn())){
|
|
if(StringUtils.isEmpty(supplier.getLevelMerchSn())){
|
|
throw new RRException("一级商户编号不能为空");
|
|
throw new RRException("一级商户编号不能为空");
|
|
|
|
+ } else if (StringUtils.isEmpty(supplier.getThirdPartyMerchCode())) {
|
|
|
|
+ throw new RRException("第三方商户不能为空");
|
|
}else{
|
|
}else{
|
|
MerchEntity merchEntity = merchDao.findByMerchSn(supplier.getLevelMerchSn());
|
|
MerchEntity merchEntity = merchDao.findByMerchSn(supplier.getLevelMerchSn());
|
|
if(merchEntity != null){
|
|
if(merchEntity != null){
|
|
@@ -68,8 +70,14 @@ public class SupplierServiceImpl implements SupplierService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int update(SupplierEntity supplier) {
|
|
public int update(SupplierEntity supplier) {
|
|
|
|
+ if (supplier.getSortOrder() == null) {
|
|
|
|
+ supplier.setSortOrder(0);
|
|
|
|
+ }
|
|
|
|
+
|
|
if(StringUtils.isEmpty(supplier.getLevelMerchSn())){
|
|
if(StringUtils.isEmpty(supplier.getLevelMerchSn())){
|
|
throw new RRException("一级商户编号不能为空");
|
|
throw new RRException("一级商户编号不能为空");
|
|
|
|
+ } else if (StringUtils.isEmpty(supplier.getThirdPartyMerchCode())) {
|
|
|
|
+ throw new RRException("第三方商户不能为空");
|
|
}else{
|
|
}else{
|
|
MerchEntity merchEntity = merchDao.findByMerchSn(supplier.getLevelMerchSn());
|
|
MerchEntity merchEntity = merchDao.findByMerchSn(supplier.getLevelMerchSn());
|
|
if(merchEntity != null){
|
|
if(merchEntity != null){
|