|  |  |  | 
|---|
|  |  |  | package com.zy.common.service.erp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.zy.core.News; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | pstm = conn.prepareStatement(sql); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("更新ERP中间表失败===>>数据库连接conn为空"); | 
|---|
|  |  |  | log.error("更新ERP中间表失败===>>" + sql); | 
|---|
|  |  |  | News.error("更新ERP中间表失败===>>数据库连接conn为空"); | 
|---|
|  |  |  | News.error("更新ERP中间表失败===>>" + sql); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return pstm.executeUpdate(); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | log.error("更新ERP中间表失败===>>" + sql); | 
|---|
|  |  |  | log.error("更新ERP中间表失败===>>" + e); | 
|---|
|  |  |  | News.error("更新ERP中间表失败===>>" + sql); | 
|---|
|  |  |  | News.error("更新ERP中间表失败===>>" + e); | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | } finally { | 
|---|
|  |  |  | release(); | 
|---|
|  |  |  | 
|---|
|  |  |  | Class.forName(erpDbProperties.getDriver_class_name()).newInstance(); | 
|---|
|  |  |  | conn = DriverManager.getConnection(erpDbProperties.getUr(), erpDbProperties.getUsername(), erpDbProperties.getPassword()); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("获取ERP数据库连接失败"); | 
|---|
|  |  |  | News.error("获取ERP数据库连接失败"); | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | throw new RuntimeException("获取ERP数据库连接失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //                Class.forName(erpDbProperties.getDriver_class_name()).newInstance(); | 
|---|
|  |  |  | //                this.conn = DriverManager.getConnection(erpDbProperties.getUr(), erpDbProperties.getUsername(), erpDbProperties.getPassword()); | 
|---|
|  |  |  | //            } catch (Exception e) { | 
|---|
|  |  |  | //                log.error("获取ERP数据库连接失败"); | 
|---|
|  |  |  | //                News.error("获取ERP数据库连接失败"); | 
|---|
|  |  |  | //                e.printStackTrace(); | 
|---|
|  |  |  | //                throw new RuntimeException("获取ERP数据库连接失败"); | 
|---|
|  |  |  | //            } | 
|---|