commit
cb8d256781
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="mailapi.jar"/>
|
||||
<classpathentry kind="lib" path="smtp.jar"/>
|
||||
<classpathentry kind="lib" path="ojdbc6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/mysql-connector-java-8.0.12.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>sendmail</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,11 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
@ -0,0 +1,10 @@
|
||||
|
||||
JdbcDriverClass=oracle.jdbc.driver.OracleDriver
|
||||
|
||||
ConnectionString=jdbc:oracle:thin:@10.200.2.43:1521:jktc
|
||||
|
||||
DbUser=infodba
|
||||
|
||||
DbPass=infodba
|
||||
|
||||
Mail=tanggg@china-goldcard.com,futt@china-goldcard.com
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
\u53D1\u5E03\u63D0\u9192=\u60A8\u597D!\n PLM\u7CFB\u7EDF\u4E2D\uFF1A\n s%\u5DF2\u7ECF\u53D1\u5E03\uFF0C\u8BF7\u53CA\u65F6\u5728TC\u4E2D\u521B\u5EFA\u5BF9\u5E94\u7684MBOM\u3002\u8C22\u8C22\uFF01
|
@ -0,0 +1,4 @@
|
||||
MAIL_SERVER=mail.shdlgroup.com
|
||||
MAIL_PORT=25
|
||||
MAIL_SENDER=plmadmin@ks.shdlgroup.com
|
||||
MAIL_SENDER_PWD=shdl@PA
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
|
||||
JdbcDriverClass=oracle.jdbc.driver.OracleDriver
|
||||
|
||||
ConnectionString=jdbc:oracle:thin:@10.200.2.43:1521:jktc
|
||||
|
||||
DbUser=infodba
|
||||
|
||||
DbPass=infodba
|
||||
|
||||
Mail=tanggg@china-goldcard.com,futt@china-goldcard.com
|
@ -0,0 +1,253 @@
|
||||
package com.connor.mail;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class FindCshSql {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SqlUtil.getMySqlConnection();
|
||||
String nameString = args[0];
|
||||
// String nameString = "00085";
|
||||
String formula = args[1];
|
||||
String value = "";
|
||||
// String formula = "(%HW#^2+(2*%MO#+2*%MO#)^2)^0.5";
|
||||
try {
|
||||
// String codeString = args[1];
|
||||
if(formula.contains("%") && formula.contains("#")) {
|
||||
while (formula.contains("%") && formula.contains("#")) {
|
||||
int indexOf = formula.indexOf('%');
|
||||
int indexOf2 = formula.indexOf('#');
|
||||
String format = formula.substring(indexOf + 1, indexOf2);
|
||||
String oldChar = formula.substring(indexOf, indexOf2 + 1);
|
||||
// System.out.println("format====" + format);
|
||||
String sql = "select param_value from design_params_history where project_name like '%"+nameString+"%' and param_code = ? order by commit_num desc ";
|
||||
ResultSet read = SqlUtil.read(sql,new String[] {format});
|
||||
if(read.next()) {
|
||||
String paramVal = read.getString(1);
|
||||
//这里加上去数据库取值的逻辑 用format去数据库去相应的值
|
||||
formula = formula.replace(oldChar, paramVal);
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(formula.contains("(")) {
|
||||
Map<String,String> formulaMap = new HashMap<String, String>();
|
||||
//遍历分别计算括号里面的公式获得新的公式
|
||||
substring(formula, formula, formulaMap);
|
||||
formula = formulaMap.get("formula");
|
||||
// System.out.println("formula====" + formula);
|
||||
value = getVal(formula);
|
||||
}else {
|
||||
value = getVal(formula);
|
||||
}
|
||||
}else {
|
||||
String sql = "select param_value from design_params_history where project_name like '%"+nameString+"%' and param_code = ? order by commit_num desc ";
|
||||
ResultSet read = SqlUtil.read(sql,new String[] {formula});
|
||||
if(read.next()) {
|
||||
value = read.getString(1);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}finally {
|
||||
SqlUtil.freeAll();
|
||||
}
|
||||
|
||||
double number = Double.parseDouble(value);
|
||||
DecimalFormat df = null;
|
||||
if(number > 1) {
|
||||
df = new DecimalFormat("#.00");
|
||||
}else {
|
||||
df = new DecimalFormat("0.00");
|
||||
}
|
||||
System.out.println(df.format(number));
|
||||
|
||||
}
|
||||
|
||||
private static int findMatchingParenthesis(String expression, int start) {
|
||||
int count = 0;
|
||||
for (int i = start + 1; i < expression.length(); i++) {
|
||||
if (expression.charAt(i) == '(') {
|
||||
count++;
|
||||
} else if (expression.charAt(i) == ')') {
|
||||
if (count == 0) {
|
||||
return i;
|
||||
}else {
|
||||
count--;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Mismatched parentheses");
|
||||
}
|
||||
|
||||
|
||||
private static int getLastNumberLength(String expression, int start) {
|
||||
int length = start + 1;
|
||||
while (length < expression.length()
|
||||
&& expression.charAt(length) != '*'
|
||||
&& expression.charAt(length) != '+'
|
||||
&& expression.charAt(length) != '-'
|
||||
&& expression.charAt(length) != '/'
|
||||
&& expression.charAt(length) != '^') {
|
||||
length++;
|
||||
}
|
||||
return length - 1;
|
||||
}
|
||||
private static int getBeforeNumberLength(String expression, int start) {
|
||||
int length = start - 1;
|
||||
while (length >= 0
|
||||
&& expression.charAt(length) != '*'
|
||||
&& expression.charAt(length) != '+'
|
||||
&& expression.charAt(length) != '-'
|
||||
&& expression.charAt(length) != '/'
|
||||
&& expression.charAt(length) != '^') {
|
||||
length--;
|
||||
}
|
||||
return length + 1;
|
||||
}
|
||||
|
||||
public static int countCharacter(String str, char characterToCount) {
|
||||
int count = 0;
|
||||
int index = str.indexOf(characterToCount);
|
||||
while (index >= 0) {
|
||||
count++;
|
||||
index = str.indexOf(characterToCount, index + 1);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
public static void substring(String formula, String expression,Map<String,String> formulaMap) {
|
||||
//有括号
|
||||
if(formula.contains("(")) {
|
||||
int indexStart = formula.indexOf("(");
|
||||
int indexEnd = findMatchingParenthesis(formula, indexStart);
|
||||
//截取括号内的公式
|
||||
String formula2 = formula.substring(indexStart + 1, indexEnd);
|
||||
if(formula2.contains("(")) {
|
||||
//获取括号内容如果还有括号继续获取括号里面的公式
|
||||
substring(formula2, expression,formulaMap);
|
||||
}else {
|
||||
//没有括号计算获得值替换原有公式
|
||||
String value = getVal(formula2);
|
||||
String formula3 = formula.replace("(" + formula2 + ")", value);
|
||||
expression = expression.replace("(" + formula2 + ")", value);
|
||||
|
||||
// expression = expression.replace("(" + formula + ")", formula3);
|
||||
//判断替换过后的公式是否还有括号
|
||||
if(expression.contains("(")) {
|
||||
int indexStart2 = expression.indexOf("(");
|
||||
int indexEnd2 = findMatchingParenthesis(expression, indexStart2);
|
||||
String formula4 = expression.substring(indexStart2 + 1, indexEnd2);
|
||||
substring(formula4, expression,formulaMap);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//没有括号直接计算获得值替换原有公式
|
||||
String value = getVal(formula);
|
||||
expression = expression.replace("(" + formula + ")", value);
|
||||
//判断替换过后的公式是否还有括号
|
||||
if(expression.contains("(")) {
|
||||
int indexStart2 = expression.indexOf("(");
|
||||
int indexEnd2 = findMatchingParenthesis(expression, indexStart2);
|
||||
String formula4 = expression.substring(indexStart2 + 1, indexEnd2);
|
||||
substring(formula4, expression,formulaMap);
|
||||
}else {
|
||||
if(expression.contains("^")
|
||||
|| expression.contains("*")
|
||||
|| expression.contains("/")
|
||||
|| expression.contains("+")
|
||||
|| expression.contains("-")) {
|
||||
expression = getVal(expression);
|
||||
formulaMap.put("formula", expression);
|
||||
}else {
|
||||
formulaMap.put("formula", expression);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public static String getVal(String formula2) {
|
||||
int indexOfStart = 0;
|
||||
int nextIndex = 0;
|
||||
int beforeIndex = 0;
|
||||
while (formula2.contains("^")) {
|
||||
indexOfStart = formula2.indexOf("^");
|
||||
nextIndex = getLastNumberLength(formula2, indexOfStart);
|
||||
beforeIndex = getBeforeNumberLength(formula2, indexOfStart);
|
||||
formula2 = jisuan(formula2, indexOfStart, beforeIndex, nextIndex, "^");
|
||||
}
|
||||
while (formula2.contains("*") || formula2.contains("/")) {
|
||||
int indexOfStart2 = formula2.indexOf("*");
|
||||
int indexOfStart3 = formula2.indexOf("/");
|
||||
if(indexOfStart2 < 0) {
|
||||
nextIndex = getLastNumberLength(formula2, indexOfStart3);
|
||||
beforeIndex = getBeforeNumberLength(formula2, indexOfStart3);
|
||||
formula2 = jisuan(formula2,indexOfStart3,beforeIndex, nextIndex,"/");
|
||||
}else if(indexOfStart3 < 0) {
|
||||
nextIndex = getLastNumberLength(formula2, indexOfStart2);
|
||||
beforeIndex = getBeforeNumberLength(formula2, indexOfStart2);
|
||||
formula2 = jisuan(formula2,indexOfStart2,beforeIndex, nextIndex,"*");
|
||||
}else if(indexOfStart2 > indexOfStart3) {
|
||||
nextIndex = getLastNumberLength(formula2, indexOfStart3);
|
||||
beforeIndex = getBeforeNumberLength(formula2, indexOfStart3);
|
||||
formula2 = jisuan(formula2,indexOfStart3,beforeIndex, nextIndex,"/");
|
||||
}else {
|
||||
nextIndex = getLastNumberLength(formula2, indexOfStart2);
|
||||
beforeIndex = getBeforeNumberLength(formula2, indexOfStart2);
|
||||
formula2 = jisuan(formula2,indexOfStart2,beforeIndex, nextIndex,"*");
|
||||
}
|
||||
|
||||
}
|
||||
while (formula2.contains("+")) {
|
||||
indexOfStart = formula2.indexOf("+");
|
||||
nextIndex = getLastNumberLength(formula2, indexOfStart);
|
||||
beforeIndex = getBeforeNumberLength(formula2, indexOfStart);
|
||||
formula2 = jisuan(formula2, indexOfStart, beforeIndex, nextIndex, "+");
|
||||
}
|
||||
while (formula2.contains("-")) {
|
||||
indexOfStart = formula2.indexOf("-");
|
||||
nextIndex = getLastNumberLength(formula2, indexOfStart);
|
||||
beforeIndex = getBeforeNumberLength(formula2, indexOfStart);
|
||||
formula2 = jisuan(formula2, indexOfStart, beforeIndex, nextIndex, "-");
|
||||
}
|
||||
return formula2;
|
||||
}
|
||||
public static String jisuan(String formula, int index, int beforeIndex, int nextIndex, String operator) {
|
||||
String subValue = formula.substring(beforeIndex, nextIndex + 1);
|
||||
// System.out.println("subValue====" + subValue);
|
||||
double firstValue = Double.parseDouble(formula.substring(beforeIndex, index));
|
||||
double secondValue = Double.parseDouble(formula.substring(index + 1, nextIndex + 1));
|
||||
double value = 0;
|
||||
switch (operator) {
|
||||
case "+":
|
||||
value = firstValue + secondValue;
|
||||
break;
|
||||
case "-":
|
||||
value = firstValue - secondValue;
|
||||
break;
|
||||
case "*":
|
||||
value = firstValue * secondValue;
|
||||
break;
|
||||
case "/":
|
||||
value = firstValue / secondValue;
|
||||
break;
|
||||
// Handle exponentiation
|
||||
case "^":
|
||||
value = Math.pow(firstValue, secondValue);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown operator: " + operator);
|
||||
}
|
||||
String result = formula.replace(subValue, value + "");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.connor.mail;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class LogUtils {
|
||||
|
||||
private static String path = "D:\\Siemens\\Teamcenter12\\bin\\";
|
||||
private static SimpleDateFormat DateFormat_filename=new SimpleDateFormat("yyyyMMdd");
|
||||
private static SimpleDateFormat DateFormat_context=new SimpleDateFormat("yyyyMMdd HH:mm:ss");
|
||||
private BufferedWriter bw;
|
||||
private String clazzStr;
|
||||
|
||||
public LogUtils(Class clazz) {
|
||||
// TODO Auto-generated constructor stub
|
||||
clazzStr = clazz.toString();
|
||||
}
|
||||
|
||||
public void createLogFile(String filename){
|
||||
try {
|
||||
String logPath = path + DateFormat_filename.format(new Date()) + filename;
|
||||
System.out.println("logPath = "+logPath);
|
||||
if(FileUtils.createFile(logPath)){
|
||||
FileWriter fw = new FileWriter(logPath,true);
|
||||
bw = new BufferedWriter(fw);
|
||||
start();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void info(String context){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[");
|
||||
sb.append(DateFormat_context.format(new Date()));
|
||||
sb.append(" info");
|
||||
sb.append("] ");
|
||||
sb.append(context);
|
||||
try {
|
||||
bw.newLine();
|
||||
bw.write(sb.toString());
|
||||
bw.flush();
|
||||
System.out.println(sb.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void error(String context){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[");
|
||||
sb.append(DateFormat_context.format(new Date()));
|
||||
sb.append(" error");
|
||||
sb.append("] ");
|
||||
sb.append(context);
|
||||
try {
|
||||
bw.newLine();
|
||||
bw.write(sb.toString());
|
||||
bw.flush();
|
||||
System.out.println(sb.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void start(){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[");
|
||||
sb.append(DateFormat_context.format(new Date()));
|
||||
sb.append("] ");
|
||||
sb.append(clazzStr);
|
||||
sb.append(".start");
|
||||
try {
|
||||
bw.newLine();
|
||||
bw.newLine();
|
||||
bw.newLine();
|
||||
bw.newLine();
|
||||
bw.write(sb.toString());
|
||||
bw.flush();
|
||||
System.out.println(sb.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void end(){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[");
|
||||
sb.append(DateFormat_context.format(new Date()));
|
||||
sb.append("] ");
|
||||
sb.append(clazzStr);
|
||||
sb.append(".end");
|
||||
try {
|
||||
bw.newLine();
|
||||
bw.write(sb.toString());
|
||||
bw.flush();
|
||||
System.out.println(sb.toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void closeLogFile(){
|
||||
if(bw!=null){
|
||||
try {
|
||||
end();
|
||||
bw.flush();
|
||||
bw.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package com.connor.mail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.HashMap;
|
||||
import java.util.Properties;
|
||||
import java.util.Vector;
|
||||
|
||||
public class SendMail {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
SendMail s=new SendMail();
|
||||
s.getstr();
|
||||
|
||||
}
|
||||
|
||||
private void getstr() {
|
||||
// TODO Auto-generated method stub
|
||||
System.out.println("start");
|
||||
Properties properties = new Properties();
|
||||
InputStream is = null;
|
||||
is = this.getClass().getClassLoader().getResourceAsStream(
|
||||
"com/connor/mail/DatabaseInfomation.properties");
|
||||
try {
|
||||
properties.load(is);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
String JdbcDriverClass = properties.getProperty("JdbcDriverClass");//"oracle.jdbc.driver.OracleDriver";
|
||||
System.out.println(JdbcDriverClass);
|
||||
String strUrl =properties.getProperty("ConnectionString"); //"jdbc:oracle:thin:@10.201.5.203:1521:tc11";
|
||||
System.out.println(strUrl);
|
||||
String strUserName =properties.getProperty("DbUser") ;//"infodba";
|
||||
System.out.println(strUserName);
|
||||
String strPassword = properties.getProperty("DbPass");//"infodba";
|
||||
System.out.println(strPassword);
|
||||
String mail = properties.getProperty("Mail");//"zhangl@connor.net.cn,hezq@connor.net.cn";
|
||||
System.out.println(mail);
|
||||
String s="";
|
||||
try {
|
||||
Class.forName(JdbcDriverClass);
|
||||
Connection conn = DriverManager.getConnection(strUrl, strUserName,
|
||||
strPassword);// 连接数据库
|
||||
String query1 = "select JK_BOM_ID,JK_BOM_REV from JK_BOM_PARENT_LINE_TABLE where JK_STATUS='2'";
|
||||
String query2 = "select JK_ITEM_ID,JK_ITEM_NAME from JK_MATERIAL_TABLE where JK_STATUS='2'";
|
||||
Statement stmt = conn.createStatement();
|
||||
ResultSet rs_get1 = stmt.executeQuery(query1);
|
||||
|
||||
String rsStr1="";
|
||||
String rsStr2="";
|
||||
if (rs_get1 != null) {
|
||||
ResultSetMetaData metaData = rs_get1.getMetaData();
|
||||
|
||||
int i_ColumnCount = metaData.getColumnCount();
|
||||
// System.out.println("i_ColumnCount:"+i_ColumnCount);
|
||||
while (rs_get1.next()) {
|
||||
// System.out.println("【BJZJ2】"+rs_get.getString("BJZJ2"));;
|
||||
//HashMap hm_unit = new HashMap();
|
||||
String str="";
|
||||
for (int i = 1; i <= i_ColumnCount; i++) {
|
||||
if(i==1){
|
||||
str=rs_get1.getString(i);
|
||||
}else{
|
||||
str=str+"/"+rs_get1.getString(i);
|
||||
}
|
||||
// hm_unit.put(metaData.getColumnName(i),
|
||||
// rs_get1.getString(i));
|
||||
// System.out.println("metaData.getColumnName(i):"+metaData.getColumnName(i));
|
||||
// System.out.println("rs_get.getString(i):"+rs_get.getString(i));
|
||||
}
|
||||
System.out.println("str="+str);
|
||||
if(!str.equals("")){
|
||||
rsStr1=rsStr1+","+str;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!rsStr1.equals("")){
|
||||
rsStr1=rsStr1.substring(1, rsStr1.length());
|
||||
s=s+"以下为传递失败的BOM:\r"+rsStr1;
|
||||
}
|
||||
ResultSet rs_get2 = stmt.executeQuery(query2);
|
||||
if (rs_get2 != null) {
|
||||
ResultSetMetaData metaData = rs_get2.getMetaData();
|
||||
|
||||
int i_ColumnCount = metaData.getColumnCount();
|
||||
// System.out.println("i_ColumnCount:"+i_ColumnCount);
|
||||
while (rs_get2.next()) {
|
||||
// System.out.println("【BJZJ2】"+rs_get.getString("BJZJ2"));;
|
||||
//HashMap hm_unit = new HashMap();
|
||||
String str="";
|
||||
for (int i = 1; i <= i_ColumnCount; i++) {
|
||||
if(i==1){
|
||||
str=rs_get2.getString(i);
|
||||
}else{
|
||||
str=str+"-"+rs_get2.getString(i);
|
||||
}
|
||||
// hm_unit.put(metaData.getColumnName(i),
|
||||
// rs_get1.getString(i));
|
||||
// System.out.println("metaData.getColumnName(i):"+metaData.getColumnName(i));
|
||||
// System.out.println("rs_get.getString(i):"+rs_get.getString(i));
|
||||
}
|
||||
System.out.println("str="+str);
|
||||
if(!str.equals("")){
|
||||
rsStr2=rsStr2+","+str;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!rsStr2.equals("")){
|
||||
rsStr2=rsStr2.substring(1, rsStr2.length());
|
||||
s=s+"\r\r以下为传递失败的ITEM:\r"+rsStr2;
|
||||
}
|
||||
//System.out.println("s="+s);
|
||||
if(!s.equals("")){
|
||||
Demo1 d=new Demo1();
|
||||
d.sendmail("U8传递失败提示", mail, s);
|
||||
System.out.println("mail="+mail);
|
||||
System.out.println("s="+s);
|
||||
}
|
||||
if (rs_get1 != null) {
|
||||
rs_get1.close();
|
||||
}
|
||||
if (rs_get2 != null) {
|
||||
rs_get2.close();
|
||||
}
|
||||
if (stmt != null) {
|
||||
stmt.close();
|
||||
}
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
\u53D1\u5E03\u63D0\u9192=\u60A8\u597D!\n PLM\u7CFB\u7EDF\u4E2D\uFF1A\n s%\u5DF2\u7ECF\u53D1\u5E03\uFF0C\u8BF7\u53CA\u65F6\u5728TC\u4E2D\u521B\u5EFA\u5BF9\u5E94\u7684MBOM\u3002\u8C22\u8C22\uFF01
|
@ -0,0 +1,4 @@
|
||||
MAIL_SERVER=mail.shdlgroup.com
|
||||
MAIL_PORT=25
|
||||
MAIL_SENDER=plmadmin@ks.shdlgroup.com
|
||||
MAIL_SENDER_PWD=shdl@PA
|
Loading…
Reference in new issue