Commit 0a78a9ca authored by Carver_Hu's avatar Carver_Hu

完善excel导入脚本

parent 331ec9b7
var query = ...
query.begin()
try {
query.insertRow({
table: '',
data: {}
})
if (query.lastError().isValid()) throw query.lastError().text()
}
catch(e) {
}
\ No newline at end of file
......@@ -34,6 +34,7 @@ db.addConnection({
var filed_list = db.query("MES_DB", function(query) {
return query.getFieldList('sec_production_order_confirmation_1');
});
cl.log('获取字段列表:' + filed_list);
// 查询当前数据库表中是否存在数据
var check_data_empty = db.query("MES_DB", function(query) {
......@@ -56,7 +57,6 @@ var get_data = db.query("MES_DB", function(query) {
});
});
//查询
data_length = get_data.length
cl.log('当前数据库表已存在行数:' + data_length);
......
This diff is collapsed.
{"order_no":"Order\n生管投料单号","confirmation":"Confirmation\n总数量","plant":"Plant\n厂别","material":"Material\n批号","material_description":"Material Description\n批次说明","posting_date":"Posting Date\n生产时间","confirmation_entry_time":"Confirmation Entry Time\n确认时间","activity":"Activity","work_center":"Work Center\n生产站别","confirmed_yield":"Confirmed Yield (GMEIN)","base_unit":"Base Unit of Measure (=GMEIN)","confirmed_scrap":"Confirmed scrap (MEINH)\n报废数量","reason_for_variance":"Reason for Variance\n报废代码","rework":"Rework\n重工数量","confirmation_text":"Confirmation text","entered_by_user":"Entered by User","ind_final_confirmation":"Ind.Final Confirmation","milestone_confirmed":"Milestone confirmed","ind_delete_doc":"Ind. delete doc."}
\ No newline at end of file
{"order_no":"Order\n生管投料单号","confirmation":"Confirmation\n总数量","plant":"Plant\n厂别","material":"Material\n批号","material_description":"Material Description\n批次说明","posting_date":"Posting Date\n生产时间","confirmation_entry_time":"Confirmation Entry Time\n确认时间","activity":"Activity","work_center":"Work Center\n生产站别","confirmed_yield":"Confirmed Yield (GMEIN)","base_unit":"Base Unit of Measure (=GMEIN)","confirmed_scrap":"Confirmed scrap (MEINH)\n报废数量","reason_for_variance":"Reason for Variance\n报废代码","rework":"Rework\n重工数量","confirmation_text":"Confirmation text","entered_by_user":"Entered by User","ind_final_confirmation":"Ind.Final Confirmation","milestone_confirmed":"Milestone confirmed","ind_delete_doc":"Ind. delete doc."}
\ No newline at end of file
var fs = require('fs');
var cl = require('console');
var _ = require('lodash');
var crypto = require('topsin.crypto');
// var filelist = fs.listDir('./', 1);
// print('当前共有文件个数:' + filelist.length);
// //查看当前目录下的文件
// var get_current_files = function(){
// var current_files = [];
// for(var i=0; i<filelist.length; i++){
// current_files.push(_.toString(filelist[i]['baseName']));
// };
// return current_files;
// }
// var current_files = get_current_files();
// cl.log(current_files);
// //查看所有的csv文件
// var get_confirmation_files = function(current_files){
// var confirmation_file = [];
// current_files.forEach(function(item){
// if(item.search('confirmation') != -1){
// confirmation_file.push(item);
// }
// });
// return confirmation_file;
// }
// var confirmation_files = get_confirmation_files(current_files);
// cl.log(confirmation_files);
// //使用md5标记一个文件被查看过多少次
// var file_check = function(current_files){
// //查看当前是否存在csv_data.json文件,如果有就读取,没有就创建
// // if(current_files.indexOf('csv_data') == -1){
// // cl.log('不存在文件csv_data');
// // };
// //cav_data初始化
// if(fs.fileExists('./csv_data.json') == false){
// cl.log('不存在文件csv_data');
// }
// };
// file_check(current_files);
// a = [1, 2, 3, 4];
// b = [1, 2, 3, 4];
// if(
// a[0] == b[0] &&
// a[1] == b[1] &&
// a[2] == b[2] &&
// a[3] == b[3]
// ){
// cl.log('有重复数据');
// }else{
// cl.log('没有重复数据');
// };
// s = {'name':'huzhihui', 'age':23}
// var str = '';
// Object.keys(s).forEach(function(item){
// str += s[item];
// });
// cl.log(str);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment