Commit 43309873 by 王勇飞

gyq

parent a404733a
......@@ -91,6 +91,7 @@ class BizOptCtl extends CtlBase {
}
*/
async distribution(mobj, qobj, req) {
console.log("bizoptCtl/distribution分配需求");
let pobj = mobj.d;
let obj = {
numbers: pobj.demand_code_list,
......
......@@ -366,24 +366,41 @@ class DeliverybillCtl extends CtlBase {
//接收票据快递单号
async receivePaperPost(pobj, qobj, req) {
var deliverInfo = await this.service.getInfo({ "bizId": pobj.bizNo });
if (deliverInfo) {
var param = {
companyId: "",//租户信息
customerName: "",//客户信息(帐套)
companyId: deliverInfo.deliveryBillInfo.deliveryInfo.setupInfo.supplier,//租户信息
customerName: deliverInfo.deliveryBillInfo.vftClientId,//客户信息(帐套)
sign: "",//签名
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);
return result;
if (j.status == 1){
return system.getResult(result);
}
else{
return system.getResultError("接收票据快递单号错误!");
}
}
else{
return system.getResultError("没有交付单信息");
}
}
//票据快递情况反馈
async confirmPaperPost(pobj, qobj, req) {
var deliverInfo = await this.service.findByClientId({ "vftClientId": pobj.customer_id });
if (deliverInfo) {
var param = {
bizNo: pobj.customer_id,//需要根据客户id获取服务示例号
accountDate: pobj.current_period,
......@@ -403,10 +420,18 @@ class DeliverybillCtl extends CtlBase {
headData: {
'Source': 'GSB'
},
requestId:uuidv4()
requestId: uuidv4()
}
return system.queueOper(pushObj);
}
else{
return system.getResultError("没有交付单信息");
}
}
}
}
......
......@@ -152,5 +152,12 @@ class DeliverybillDao extends Dao {
var oid = pobj.bizId;
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;
......@@ -289,6 +289,54 @@ class DeliverybillService extends ServiceBase {
salesmanName: deliveryBillInfo.salesman_name,//业务员名称
salesmanPhone: deliveryBillInfo.salesman_phone,//业务员联系方式
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,//创建时间
updatedAt: deliveryBillInfo.updated_at,//更新时间
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