| | |
| | | try { |
| | | Customer customer = JSONObject.parseObject(JSONObject.toJSONString(object.get("customer")), Customer.class); |
| | | if(customer!=null){ |
| | | Integer count = customerMapper.countByCustomerName(customer); |
| | | if (count > 0) { |
| | | saveState = false; |
| | | }else { |
| | | if (customer.getId()!=null && customer.getId()!=0){ |
| | | customerMapper.updateCustomer(customer); |
| | | log.setFunction("insertCustomer修改"); |
| | |
| | | } |
| | | logService.saveLog(log); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |