Commit b7fb33ee by 王勇飞

Merge branch 'ic-deliver' of gitlab.gongsibao.com:jiangyong/zhichan into ic-deliver

parents 60bd5d59 21580065
...@@ -14,17 +14,8 @@ class BizChanceAPI extends APIBase { ...@@ -14,17 +14,8 @@ class BizChanceAPI extends APIBase {
*/ */
async statBizChanceCountBySp(p,q,req){ async statBizChanceCountBySp(p,q,req){
let params={} let bizStatus=p.bizStatus
params.group={ let rtn=await this.bizChanceS.statBizChanceCountBySp(bizStatus)
byFields:['facilitator_name'],
actionType:'count',
aggField:'id',
aliasField:' as chanceCount',
tblName:'bussiness_opportunity',
where:'',
having:'',
}
let rtn=await this.bizChanceS.statBizChanceCountBySp(params)
return system.getResult(rtn) return system.getResult(rtn)
} }
......
...@@ -6,6 +6,16 @@ class BizDeliverAPI extends APIBase { ...@@ -6,6 +6,16 @@ class BizDeliverAPI extends APIBase {
super(); super();
this.bizDeliveryS=system.getObject("service.bizchance.deliverybillSve") this.bizDeliveryS=system.getObject("service.bizchance.deliverybillSve")
} }
async statBizDeliveryCountBySp(p,q,req){
let bizStatus=p.bizStatus
let rtn=await this.bizDeliveryS.statBizDeliveryCountBySp(bizStatus)
return system.getResult(rtn)
}
async statBizDeliverySettleAmountBySp(p,q,req){
let bizStatus=p.bizStatus
let rtn=await this.bizDeliveryS.statBizDeliverySettleAmountBySp(bizStatus)
return system.getResult(rtn)
}
/** /**
* 待处理商机beforeSubmission * 待处理商机beforeSubmission
* 处理中商机 beforeConfirmation * 处理中商机 beforeConfirmation
......
...@@ -62,6 +62,7 @@ class DeliverybillCtl extends CtlBase { ...@@ -62,6 +62,7 @@ class DeliverybillCtl extends CtlBase {
}; };
robj.payAmount = this.FenToYuan(element.selling_price);//交付单金额 robj.payAmount = this.FenToYuan(element.selling_price);//交付单金额
robj.deliverStatus = element.delivery_status;//交付单状态 robj.deliverStatus = element.delivery_status;//交付单状态
robj.delivery_status = element.delivery_status;//交付单状态
robj.contactsName = robj.baseInfo.contactsName;//联系人 robj.contactsName = robj.baseInfo.contactsName;//联系人
robj.contactsPhone = robj.baseInfo.contactsPhone;//联系电话 robj.contactsPhone = robj.baseInfo.contactsPhone;//联系电话
robj.clerkName = element.salesman_name;//业务员名称 robj.clerkName = element.salesman_name;//业务员名称
......
...@@ -11,6 +11,10 @@ class DeliverybillDao extends Dao { ...@@ -11,6 +11,10 @@ class DeliverybillDao extends Dao {
extraWhere(qobj, qw, qc) {//根据业务员id获取交付单信息的组装条件 extraWhere(qobj, qw, qc) {//根据业务员id获取交付单信息的组装条件
//qc.raw = true; //qc.raw = true;
//检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据 //检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据
if(qw["delivery_status"]=="handling"){//解决首页多状态查询
qw["delivery_status"]= { [this.db.Op.notIn]:['received', 'success', 'closed']}
}
if (qobj.company_id == 1) { if (qobj.company_id == 1) {
if (qobj.bizpath && qobj.bizpath != "") { if (qobj.bizpath && qobj.bizpath != "") {
if (qobj.bizpath.indexOf("pmxdeliverrequest") > 0) {//说明是从商机列表过来的 if (qobj.bizpath.indexOf("pmxdeliverrequest") > 0) {//说明是从商机列表过来的
...@@ -18,6 +22,7 @@ class DeliverybillDao extends Dao { ...@@ -18,6 +22,7 @@ class DeliverybillDao extends Dao {
qw["settle_status"] = "waittosettle"; qw["settle_status"] = "waittosettle";
} }
} }
return qw return qw
} else { } else {
//需要添加公司查询条件 //需要添加公司查询条件
......
...@@ -6,7 +6,17 @@ class BizOptService extends ServiceBase { ...@@ -6,7 +6,17 @@ class BizOptService extends ServiceBase {
constructor() { constructor() {
super("bizchance", ServiceBase.getDaoName(BizOptService)); super("bizchance", ServiceBase.getDaoName(BizOptService));
} }
async statBizChanceCountBySp(params){ async statBizChanceCountBySp(bizStatus){
let params={}
params.group={
byFields:['facilitator_name'],
actionType:'count',
aggField:'id',
aliasField:' as chanceCount',
tblName:'bussiness_opportunity',
where:bizStatus!=""?`where business_status='${bizStatus}'`:'',
having:'',
}
let s=await this.dao.statGroupBy(params,null) let s=await this.dao.statGroupBy(params,null)
return s return s
} }
......
...@@ -9,6 +9,41 @@ class DeliverybillService extends ServiceBase { ...@@ -9,6 +9,41 @@ class DeliverybillService extends ServiceBase {
this.logDao = system.getObject("db.bizchance.statuslogDao"); this.logDao = system.getObject("db.bizchance.statuslogDao");
this.cacheDao = system.getObject("db.bizchance.cacheinfoDao"); this.cacheDao = system.getObject("db.bizchance.cacheinfoDao");
} }
async statBizDeliverySettleAmountBySp(settleStatus){
let params={}
let where=settleStatus!=""?`where settle_status='${settleStatus}'`:''
params.group={
byFields:['facilitator_name'],
actionType:'sum',
aggField:'cost_price',
aliasField:' as chanceCount',
tblName:'delivery_bill',
where:where,
having:'',
}
let s=await this.dao.statGroupBy(params,null)
return s
}
async statBizDeliveryCountBySp(deliverStatus){
let params={}
let where=deliverStatus!=""?`where delivery_status='${deliverStatus}'`:''
if(deliverStatus=="handling"){
where= `where delivery_status not in ('received', 'success', 'closed')`
}
params.group={
byFields:['facilitator_name'],
actionType:'count',
aggField:'id',
aliasField:' as chanceCount',
tblName:'delivery_bill',
where:where,
having:'',
}
let s=await this.dao.statGroupBy(params,null)
return s
}
async statBizDelivery(companyId, opath, username, userid) { async statBizDelivery(companyId, opath, username, userid) {
//如果当前登录人是平台,返回所有商机 //如果当前登录人是平台,返回所有商机
let waittoHandledCount = 0//received let waittoHandledCount = 0//received
......
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