|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | customer.create(SecurityUtils.getUserId()); | 
|---|
|  |  |  | customer.setIsEnabled(true); | 
|---|
|  |  |  | customerMapper.insert(customer); | 
|---|
|  |  |  | } else {//重新修改 | 
|---|
|  |  |  | customer = customerMapper.selectById(dto.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public void isEnable(Long id) { | 
|---|
|  |  |  | Customer customer = customerMapper.selectById(id); | 
|---|
|  |  |  | if (customer == null) { | 
|---|
|  |  |  | throw new ValidationException("商户信息不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (customer.getIsEnabled()) { | 
|---|
|  |  |  | customer.setIsEnabled(false); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | customer.setIsEnabled(true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | customer.update(SecurityUtils.getUserId()); | 
|---|
|  |  |  | customerMapper.updateById(customer); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|