Commit a12a65fb by v_vjyjiang

allocate

parent 9a300ff1
......@@ -392,7 +392,7 @@ class UserService extends ServiceBase {
*/
async getBizUserForBizChance (clientMobile, spName, productCatName, regionName) {
var self = this
clientMobile = clientMobile + "_" + spName + "_" + regionName
clientMobile = clientMobile + "_" + spName + "_" + regionName + "_" + productCatName
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
return this.db.transaction(async function (t) {
//先检查缓存是否存在bizuser
......@@ -420,13 +420,13 @@ class UserService extends ServiceBase {
let users = companyFind.us
let cansels = users.filter(u => {
if (regionName && regionName != "" && u.regiontags) {
if (u.isAllocated && u.skilltags.indexOf(productCatName) >= 0 && u.regiontags.indexOf(regionName) >= 0) {
if (u.isAllocated && u.isSalesman && u.skilltags.indexOf(productCatName) >= 0 && u.regiontags.indexOf(regionName) >= 0) {
return true
} else {
return false
}
} else {
if (u.isAllocated && u.skilltags.indexOf(productCatName) >= 0) {
if (u.isAllocated && u.isSalesman && u.isAllArea && u.skilltags.indexOf(productCatName) >= 0) {
return true
} else {
return false
......@@ -471,7 +471,7 @@ class UserService extends ServiceBase {
* @param {*} regionName 区域
*/
async getBizUserForDelivery (xclientMobile, spName, productCatName, skucode, regionName) {
let clientMobile = 'fordeliver' + xclientMobile + "_" + spName + "_" + regionName
let clientMobile = 'fordeliver' + xclientMobile + "_" + spName + "_" + regionName + "_" + productCatName
var self = this
//按照服务商名字查询到公司,按照公司查询出users,条件是可以接受派单任务,并且技能标签含有,产品类别名称
return this.db.transaction(async function (t) {
......@@ -519,13 +519,13 @@ class UserService extends ServiceBase {
let users = companyFind.us
let cansels = users.filter(u => {
if (regionName && regionName != "" && u.regiontags) {
if (u.isAllocated && u.skilltags.indexOf(productCatName) >= 0 && u.regiontags.indexOf(regionName) >= 0) {
if (u.isAllocated && u.isDelivery && u.skilltags.indexOf(productCatName) >= 0 && u.regiontags.indexOf(regionName) >= 0) {
return true
} else {
return false
}
} else {
if (u.isAllocated && u.skilltags.indexOf(productCatName) >= 0) {
if (u.isAllocated && u.isDelivery && u.isAllArea && u.skilltags.indexOf(productCatName) >= 0) {
return true
} else {
return false
......
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