|
@@ -107,7 +107,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
@Override
|
|
@Override
|
|
public Boolean add(CustomerDTO customer){
|
|
public Boolean add(CustomerDTO customer){
|
|
customer.setUserId(LoginContext.getUserId());
|
|
customer.setUserId(LoginContext.getUserId());
|
|
- customer.setCity(JSON.toJSONString(customer.getCitys()));
|
|
|
|
|
|
+ List<Long> citys = customer.getCitys();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(citys)){
|
|
|
|
+ customer.setCity(JSON.toJSONString(citys));
|
|
|
|
+ }
|
|
return this.save(customer);
|
|
return this.save(customer);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -118,7 +121,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
}
|
|
}
|
|
@Override
|
|
@Override
|
|
public Boolean update(CustomerDTO customer){
|
|
public Boolean update(CustomerDTO customer){
|
|
- customer.setCity(JSON.toJSONString(customer.getCitys()));
|
|
|
|
|
|
+ List<Long> citys = customer.getCitys();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(citys)){
|
|
|
|
+ customer.setCity(JSON.toJSONString(citys));
|
|
|
|
+ }
|
|
return this.updateById(customer);
|
|
return this.updateById(customer);
|
|
}
|
|
}
|
|
|
|
|