Commit 1cb0282f by 王昆

gsb

parent b757fcc4
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
const settings = require("../../../../config/settings")
const moment = require("moment");
class BusinessmenService extends ServiceBase {
constructor() {
......@@ -33,11 +34,34 @@ class BusinessmenService extends ServiceBase {
*/
async createAccount(params){
try {
//todo somthing ...
// 查个体户
let businessmen = await this.callms("order", "queryObusinessmen", params);
businessmen = businessmen.data;
// 查个体户的交付商
var deliver = await this.callms("common", "deliverInfo", {id: params.deliver_id});
deliver = deliver.data;
if(1==1){
return await this.callms("order", "createAccount", params);
var deliver = await this.callms("common", "deliverInfo", {id: params.deliver_id});
let data = {
customerName: businessmen.name,
initPeriod: new Date(moment().format("YYYY-MM") + "-01 00:00:00").getTime(),
// initPeriod: moment().format("YYYYMM"),
accountStandard: 1,
valueAddedTax: 2,
bankStatus: businessmen.is_bank ? 1 : 0,
accountant:"管理员",
province: params.province,
companyId: deliver.nt_company_id,
}
let url = settings.ntapi().createCustomer;
let res = await this.callApi(url, data, "建账");
console.log(res);
if(!res || !res.data || !res.data.datas) {
return system.getResult(null, "建账失败");
}
// let _d = res.data.datas;
// return await this.callms("order", "createAccount", params);
} catch (error) {
console.log(error);
return system.getResult(error);
......
......@@ -182,7 +182,7 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
order: domain + ":3103" + path,
order: domain2 + ":3103" + path,
// order: "http://127.0.0.1:3103" + 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