chenlu
2024-09-06 d809ecd16cbb23f5aad86a6844f51ffea0455fe8
north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
@@ -46,21 +46,21 @@
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try {
            Customer customer = JSONObject.parseObject(JSONObject.toJSONString(object.get("customer")), Customer.class);
            customer=null;
           if(customer!=null){
               if (customer.getId()!=null && customer.getId()!=0){
                   customerMapper.updateCustomer(customer);
               }else{
                   customerMapper.insertCustomer(customer);
               }
           }
        } catch (Exception e) {
            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
            //将异常传入数据库
            SysError sysError = new SysError();
            sysError.setError(e+Arrays.toString(e.getStackTrace()));
            sysError.setFunc("insertCustomer");
            sysError.setError(Arrays.toString(e.getStackTrace()));
            sysError.setFunc("saveOrder");
            sysErrorService.insert(sysError);
            saveState = false;
@@ -88,8 +88,8 @@
            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
            //将异常传入数据库
            SysError sysError = new SysError();
            sysError.setError(e+Arrays.toString(e.getStackTrace()));
            sysError.setFunc("deleteCustomer");
            sysError.setError(e.toString());
            sysError.setFunc("saveOrder");
            sysErrorService.insert(sysError);
            saveState = false;