Commit 77c11b9b by 王昆

gsb

parent fb66d275
...@@ -73,6 +73,8 @@ class TradeService extends ServiceBase { ...@@ -73,6 +73,8 @@ class TradeService extends ServiceBase {
let result = await this.countAmt(itemList, info, params); let result = await this.countAmt(itemList, info, params);
let current = new Date(); let current = new Date();
let projectName;
for (let item of itemList) { for (let item of itemList) {
item.amt = system.y2f(item.actual_amt); item.amt = system.y2f(item.actual_amt);
item.actual_amt = system.y2f(item.actual_amt); item.actual_amt = system.y2f(item.actual_amt);
...@@ -85,6 +87,7 @@ class TradeService extends ServiceBase { ...@@ -85,6 +87,7 @@ class TradeService extends ServiceBase {
item.trade_status = "00"; item.trade_status = "00";
item.trade_desc = "商户自行交易"; item.trade_desc = "商户自行交易";
} }
projectName = item.project_name;
} }
let out_trade_no = await this.redisClient.genrateId("gsb_out_trade_no"); let out_trade_no = await this.redisClient.genrateId("gsb_out_trade_no");
...@@ -102,6 +105,7 @@ class TradeService extends ServiceBase { ...@@ -102,6 +105,7 @@ class TradeService extends ServiceBase {
acc_type: params.acc_type, acc_type: params.acc_type,
order_file: params.fileUrl, order_file: params.fileUrl,
order_type: order_type, order_type: order_type,
project_name: projectName,
// 付款凭证信息 // 付款凭证信息
pay_voucher: "", pay_voucher: "",
pay_bank_account: main.bank_account, pay_bank_account: main.bank_account,
...@@ -224,6 +228,9 @@ class TradeService extends ServiceBase { ...@@ -224,6 +228,9 @@ class TradeService extends ServiceBase {
return system.getResult(null, "打款文件无数据") return system.getResult(null, "打款文件无数据")
} }
let rows = sheet.data; let rows = sheet.data;
let projectRow = rows[2];
let projectName = projectRow.length >= 2 ? projectRow[1] : "";
let itemList = []; let itemList = [];
for (let idx = 6; idx < rows.length; idx++) { for (let idx = 6; idx < rows.length; idx++) {
var data = { var data = {
...@@ -232,20 +239,24 @@ class TradeService extends ServiceBase { ...@@ -232,20 +239,24 @@ class TradeService extends ServiceBase {
let cells = rows[idx]; let cells = rows[idx];
let cellLength = cells.length; let cellLength = cells.length;
if (cellLength == 0) { if (cellLength == 0) {
continue; continue;
} }
if (cellLength < 7) { if (cellLength < 6) {
data.errors.push("缺少数据, 列数不全"); data.errors.push("缺少数据, 列数不全");
continue; continue;
} }
data.project_name = projectName;
data.acc_name = this.trim(cells[1]); data.acc_name = this.trim(cells[1]);
data.credit_code = this.trim(cells[2]).toUpperCase(); data.credit_code = this.trim(cells[2]).toUpperCase();
data.acc_no = this.trim(cells[3]); data.acc_no = this.trim(cells[3]);
data.open_bank = this.trim(cells[4]); data.open_bank = this.trim(cells[4]);
data.amt = this.trim(cells[5]); data.amt = this.trim(cells[5]);
data.remark = this.trim(cells[6]); if (cellLength == 6) {
data.remark = "";
} else {
data.remark = this.trim(cells[6]);
}
itemList.push(data); itemList.push(data);
} }
......
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