Commit fce5aa90 by 王昆

Merge branch 'xgg-saas-merchant' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-saas-merchant

parents d58e6a77 1b38ea21
......@@ -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];
......
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