Commit 43309873 by 王勇飞

gyq

parent a404733a
...@@ -91,6 +91,7 @@ class BizOptCtl extends CtlBase { ...@@ -91,6 +91,7 @@ class BizOptCtl extends CtlBase {
} }
*/ */
async distribution(mobj, qobj, req) { async distribution(mobj, qobj, req) {
console.log("bizoptCtl/distribution分配需求");
let pobj = mobj.d; let pobj = mobj.d;
let obj = { let obj = {
numbers: pobj.demand_code_list, numbers: pobj.demand_code_list,
......
...@@ -366,47 +366,72 @@ class DeliverybillCtl extends CtlBase { ...@@ -366,47 +366,72 @@ class DeliverybillCtl extends CtlBase {
//接收票据快递单号 //接收票据快递单号
async receivePaperPost(pobj, qobj, req) { async receivePaperPost(pobj, qobj, req) {
var param = { var deliverInfo = await this.service.getInfo({ "bizId": pobj.bizNo });
companyId: "",//租户信息 if (deliverInfo) {
customerName: "",//客户信息(帐套) var param = {
sign: "",//签名 companyId: deliverInfo.deliveryBillInfo.deliveryInfo.setupInfo.supplier,//租户信息
postWay: "2", customerName: deliverInfo.deliveryBillInfo.vftClientId,//客户信息(帐套)
currentPeriod: pobj.actionBody.accountDate, sign: "",//签名
courierNumber: pobj.actionBody.expressNum postWay: "2",
currentPeriod: pobj.actionBody.accountDate,
courierNumber: pobj.actionBody.expressNum
}
param.sign = await toFtClient.postToFtBySign("/customerReceiveBill/addCusReceiveBill",param.companyId);
var rc = this.getObject("util.execClient");
var reqUrl = settings.ftConfig.url + "/customerReceiveBill/addCusReceiveBill";
var result = await rc.execPost(param, reqUrl);
var j = JSON.parse(result.stdout);
if (j.status == 1){
return system.getResult(result);
}
else{
return system.getResultError("接收票据快递单号错误!");
}
} }
var rc = this.getObject("util.execClient"); else{
var reqUrl = settings.ftConfig.url + "/customerReceiveBill/addCusReceiveBill"; return system.getResultError("没有交付单信息");
var result = await rc.execPost(param, reqUrl); }
var j = JSON.parse(result.stdout);
return result;
} }
//票据快递情况反馈 //票据快递情况反馈
async confirmPaperPost(pobj, qobj, req) { async confirmPaperPost(pobj, qobj, req) {
var param = { var deliverInfo = await this.service.findByClientId({ "vftClientId": pobj.customer_id });
bizNo: pobj.customer_id,//需要根据客户id获取服务示例号 if (deliverInfo) {
accountDate: pobj.current_period, var param = {
status: pobj.status, bizNo: pobj.customer_id,//需要根据客户id获取服务示例号
errorStatus: -1 accountDate: pobj.current_period,
} status: pobj.status,
if (pobj.remark) { errorStatus: -1
param.remark = pobj.remark;
if (pobj.remark.includes("进销项发票不全")) {
param.errorStatus = 1;
} }
if (pobj.remark) {
param.remark = pobj.remark;
if (pobj.remark.includes("进销项发票不全")) {
param.errorStatus = 1;
}
}
var pushObj = {
pushUrl: this.rysUrl + "service/paperPost/confirm",
actionType: "confirm",
messageBody: param,
headData: {
'Source': 'GSB'
},
requestId: uuidv4()
}
return system.queueOper(pushObj);
} }
var pushObj = { else{
pushUrl: this.rysUrl + "service/paperPost/confirm", return system.getResultError("没有交付单信息");
actionType: "confirm",
messageBody: param,
headData: {
'Source': 'GSB'
},
requestId:uuidv4()
} }
return system.queueOper(pushObj);
} }
}
} }
......
...@@ -152,5 +152,12 @@ class DeliverybillDao extends Dao { ...@@ -152,5 +152,12 @@ class DeliverybillDao extends Dao {
var oid = pobj.bizId; var oid = pobj.bizId;
return await this.findOne({ biz_id: oid }); return await this.findOne({ biz_id: oid });
} }
/**
* 根据客户ID(帐套)查找服务所有信息
*/
async findByClientId(pobj) {
var oid = pobj.vftClientId;
return await this.findOne({ v_ftClientId: oid });
}
} }
module.exports = DeliverybillDao; module.exports = DeliverybillDao;
...@@ -289,6 +289,54 @@ class DeliverybillService extends ServiceBase { ...@@ -289,6 +289,54 @@ class DeliverybillService extends ServiceBase {
salesmanName: deliveryBillInfo.salesman_name,//业务员名称 salesmanName: deliveryBillInfo.salesman_name,//业务员名称
salesmanPhone: deliveryBillInfo.salesman_phone,//业务员联系方式 salesmanPhone: deliveryBillInfo.salesman_phone,//业务员联系方式
sourceName: deliveryBillInfo.source_name,//渠道名称 sourceName: deliveryBillInfo.source_name,//渠道名称
vftClientId: deliveryBillInfo.v_ftClientId,// 客户ID(帐套)
createdAt: deliveryBillInfo.created_at,//创建时间
updatedAt: deliveryBillInfo.updated_at,//更新时间
version: deliveryBillInfo.version,//o
masterSourceNumber: deliveryBillInfo.master_source_number,//主来源单
settleStatus: deliveryBillInfo.settle_status,//结算状态
settlebillId: deliveryBillInfo.settlebill_id,//结算单id
deliveryManId: deliveryBillInfo.delivery_man_id,//销售员id
deliveryManName: deliveryBillInfo.delivery_man_name,//销售员姓名
deliveryManOpcode: deliveryBillInfo.delivery_man_opcode,//销售员opcode
bizId: pobj.bizId//融易算-服务实例id
}
return result;
}
//根据客户ID(帐套)查询deliverybill表中的所有信息
async getInfobyClientId(pobj){
let result = {};
let deliveryBillInfo = await this.dao.findByClientId(pobj);
// console.log("gggg"+deliveryBillInfo+pobj.bizId)
if (!deliveryBillInfo) {
throw new Error("没有服务信息");
}
//封装deliverybill表数据
result.deliveryBillInfo = {
deliveryCode: deliveryBillInfo.delivery_code,//交付单编号
sourceNumber: deliveryBillInfo.source_number,//渠道来源编号
demandCode: deliveryBillInfo.demand_code,//商机编号
skuCode: deliveryBillInfo.sku_code,//sku编号
schemeNumber: deliveryBillInfo.scheme_number,//方案编号
productCode: deliveryBillInfo.product_code,//产品编码
productName: deliveryBillInfo.product_name,//产品名称
serviceAddress: deliveryBillInfo.service_address,//服务地区
deliveryInfo: deliveryBillInfo.delivery_info,//交付单详情
payStatus: deliveryBillInfo.pay_status,//交付状态-虚拟字段
vConame: deliveryBillInfo.v_coname,//联系人-虚拟字段
vCophone: deliveryBillInfo.v_cophone,//联系电话-虚拟字段
delivery_status: deliveryBillInfo.delivery_status,//交付单状态
sellingPrice: deliveryBillInfo.selling_price,//交付单价格
costPrice: deliveryBillInfo.cost_price,//成本价
closeReason: deliveryBillInfo.close_reason,//状态为关闭原因
facilitatorId: deliveryBillInfo.facilitator_id,//服务商id
facilitatorName: deliveryBillInfo.facilitator_name,//服务商名称
salesmanOpcode: deliveryBillInfo.salesman_opcode,//业务员opcode
salesmanId: deliveryBillInfo.salesman_id,//业务员id
salesmanName: deliveryBillInfo.salesman_name,//业务员名称
salesmanPhone: deliveryBillInfo.salesman_phone,//业务员联系方式
sourceName: deliveryBillInfo.source_name,//渠道名称
vftClientId: deliveryBillInfo.v_ftClientId,// 客户ID(帐套)
createdAt: deliveryBillInfo.created_at,//创建时间 createdAt: deliveryBillInfo.created_at,//创建时间
updatedAt: deliveryBillInfo.updated_at,//更新时间 updatedAt: deliveryBillInfo.updated_at,//更新时间
version: deliveryBillInfo.version,//o version: deliveryBillInfo.version,//o
......
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