Commit 1b38ea21 by 王昆

gsb

parent c00910d5
......@@ -57,7 +57,7 @@ class TradeService extends ServiceBase {
return system.getResultFail(-1, `锁定批次无数据`, itemList);
}
// 验证字段
let error = await this.checkItemList(itemList);
let error = await this.checkItemList(itemList, params.saas_merchant_id);
if (error) {
return system.getResultFail(-1, `批次内有错误数据,请检查后修改`, itemList);
}
......@@ -98,6 +98,9 @@ class TradeService extends ServiceBase {
itemList: itemList
};
let rs = await this.callms("trade", "orderAdd", order);
if (rs.data) {
this.transFields([rs.data]);
}
return rs;
}
......@@ -126,7 +129,7 @@ class TradeService extends ServiceBase {
let itemList = await this.readItems(params.fileUrl, params.fileName);
// 验证字段
let error = await this.checkItemList(itemList);
let error = await this.checkItemList(itemList, params.saas_merchant_id);
// 计算预计付款基恩
let result = await this.countAmt(itemList, info);
......@@ -225,7 +228,7 @@ class TradeService extends ServiceBase {
}
}
async checkItemList(itemList) {
async checkItemList(itemList, saas_merchant_id) {
let error = false;
if (!itemList || itemList.length == 0) {
return system.getResult(null, "打款文件无数据")
......@@ -236,7 +239,12 @@ class TradeService extends ServiceBase {
for (let data of itemList) {
creditCodes.push(data.credit_code);
}
let creditCodeMap = await this.orderSve.mapByCreditCodes({creditCodes: creditCodes, attrs: "sve_businessmen_credit_code"});
let creditCodeMap = await this.orderSve.mapByCreditCodes({
saas_merchant_id: saas_merchant_id,
creditCodes: creditCodes,
attrs: "credit_code"
});
for (let data of itemList) {
this.checkField(data, "acc_name", {name: "收款户名", is_require: true, maxLen: 64});
let bm = creditCodeMap[data.credit_code];
......
......@@ -181,7 +181,7 @@ class System {
merchant: dev + ":3101" + path,
// 订单服务
order: local + ":3103" + path,
order: dev + ":3103" + path,
// 发票服务
invoice: dev + ":3105" + path,
......
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