Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
fab0d54a
Commit
fab0d54a
authored
Aug 17, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pp
parent
3958de66
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
268 additions
and
27 deletions
+268
-27
tx-fi-tax/app/base/controller/impl/bizchance/bizoptCtl.js
+38
-11
tx-fi-tax/app/base/controller/impl/bizchance/fitaxcompanyCtl.js
+27
-0
tx-fi-tax/app/base/controller/impl/bizchance/fitaxschemeCtl.js
+27
-0
tx-fi-tax/app/base/db/impl/bizchance/bizoptDao.js
+5
-5
tx-fi-tax/app/base/db/impl/bizchance/fitaxcompanyDao.js
+32
-6
tx-fi-tax/app/base/db/impl/bizchance/fitaxschemeDao.js
+32
-5
tx-fi-tax/app/base/db/metadata/app/platform.js
+9
-0
tx-fi-tax/app/base/service/impl/bizchance/fitaxcompanySve.js
+49
-0
tx-fi-tax/app/base/service/impl/bizchance/fitaxschemeSve.js
+49
-0
No files found.
tx-fi-tax/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
fab0d54a
...
...
@@ -19,7 +19,7 @@ class BizOptCtl extends CtlBase {
/**
* 根据用户id获取商机信息,分页获取
* @param pobj
* @param
{*}
pobj
*/
async
findAndCountAll
(
pobj
,
qobj
,
req
)
{
try
{
...
...
@@ -72,22 +72,50 @@ class BizOptCtl extends CtlBase {
/**
* 需求分配 TODO
* @param mobj
* @param qobj
* @param req
* @param
{*}
mobj
* @param
{*}
qobj
* @param
{*}
req
*/
async
distribution
(
mobj
,
qobj
,
req
)
{
let
pobj
=
mobj
.
d
;
let
params
=
{
demandCodeList
:
[
"1"
,
"2"
,
"3"
],
//至少一个需求编号
salesman_id
:
"jdlfaj"
//唯一标识
demand_code_list
:
[
"1"
,
"2"
,
"3"
],
//至少一个需求编号
salesman_opcode
:
""
,
//唯一标识
salesman_id
:
"jdlfaj"
,
//销售员id
salesman_name
:
""
,
//销售员姓名
salesman_phone
:
""
,
//销售员手机号
}
}
/*根据商机编号获取商机详情*/
/**
* 关闭需求
* @param {*} mobj
*/
async
closeBizopt
(
mobj
,
qobj
,
req
)
{
let
pobj
=
mobj
.
d
;
pobj
.
business_status
=
"isClosed"
;
let
params
=
{
demand_code
:
""
,
//需求编号
close_reason
:
""
,
//关闭原因
}
//根据需求编号去更新该条需求的状态为已关闭
try
{
let
res
=
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
//TODO 同步该需求关闭信息到其他系统
return
system
.
getResult
(
"关闭需求成功!"
);
}
catch
(
error
)
{
return
system
.
getResultError
(
"bizoptCtl/closeBizopt 关闭需求出错!"
);
}
}
/**
* 根据需求编号获取需求详情
* @param {*} mobj
*/
async
findInfoByDemandCode
(
mobj
,
qobj
,
req
)
{
var
pobj
=
mobj
.
d
;
if
(
pobj
.
businessMode
&&
pobj
.
businessM
ode
!=
'undefined'
)
{
if
(
pobj
.
demand_code
&&
pobj
.
demand_c
ode
!=
'undefined'
)
{
try
{
var
rs
=
await
this
.
service
.
findInfoByDemandCode
(
pobj
);
var
ms
=
await
this
.
schemeService
.
findInfoByDemandCode
(
pobj
);
...
...
@@ -95,7 +123,7 @@ class BizOptCtl extends CtlBase {
if
(
rs
)
{
var
statusInfo
=
{
"currentStatus"
:
rs
.
business_status
};
//商机状态
var
businessInfo
=
{};
businessInfo
.
businessM
ode
=
rs
.
demand_code
;
//商机编号
businessInfo
.
demand_c
ode
=
rs
.
demand_code
;
//商机编号
businessInfo
.
channelSource
=
appconfig
.
pdict
.
source
[
rs
.
source_name
];
///渠道来源
// businessInfo.businessType = rs.business_type;//商机类型代码
businessInfo
.
businessType
=
appconfig
.
pdict
.
businessType
[
rs
.
business_type
];
//商机类型名称
...
...
@@ -142,7 +170,6 @@ class BizOptCtl extends CtlBase {
return
system
.
getResultError
(
"参数错误!"
);
}
}
/*更新业务员信息*/
async
updateSalesmanInfoByDemandCode
(
mobj
,
qobj
,
req
)
{
var
pobj
=
mobj
.
d
;
...
...
@@ -203,7 +230,7 @@ class BizOptCtl extends CtlBase {
"clerkName"
:
res
.
salesman_name
,
"clerkId"
:
res
.
salesman_id
}
await
this
.
logService
.
insertInfo
(
logInfo
);
//插入状态日
至
表
await
this
.
logService
.
insertInfo
(
logInfo
);
//插入状态日
志
表
}
if
(
pobj
.
currentStatus
==
"isClosed"
)
{
//关闭需求时调用
...
...
tx-fi-tax/app/base/controller/impl/bizchance/fitaxcompanyCtl.js
0 → 100644
View file @
fab0d54a
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
appconfig
=
system
.
getSysConfig
();
class
FitaxcompanyCtl
extends
CtlBase
{
constructor
()
{
super
(
"bizchance"
,
CtlBase
.
getServiceName
(
FitaxcompanyCtl
));
}
/**
* 新建企业信息
* @param {*} mobj
*/
async
insertInfo
(
mobj
,
qobj
,
req
)
{
let
pobj
=
mobj
.
d
;
try
{
if
(
!
pobj
.
demand_code
)
{
return
system
.
getResultError
(
"fitaxschemeCtl/insertInfo 缺少需求编号!"
);
}
let
res
=
await
this
.
service
.
insertInfo
(
pobj
);
return
system
.
getResult
(
"新建方案成功!"
);
}
catch
(
error
)
{
return
system
.
getResultError
(
"fitaxschemeCtl/insertInfo 新建方案出错!"
);
}
}
}
module
.
exports
=
FitaxcompanyCtl
;
tx-fi-tax/app/base/controller/impl/bizchance/fitaxschemeCtl.js
0 → 100644
View file @
fab0d54a
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
appconfig
=
system
.
getSysConfig
();
class
FitaxschemeCtl
extends
CtlBase
{
constructor
()
{
super
(
"bizchance"
,
CtlBase
.
getServiceName
(
FitaxschemeCtl
));
}
/**
* 新建方案信息
* @param {*} mobj
*/
async
insertInfo
(
mobj
,
qobj
,
req
)
{
let
pobj
=
mobj
.
d
;
try
{
if
(
!
pobj
.
demand_code
)
{
return
system
.
getResultError
(
"fitaxschemeCtl/insertInfo 缺少需求编号!"
);
}
let
res
=
await
this
.
service
.
insertInfo
(
pobj
);
return
system
.
getResult
(
"新建方案成功!"
);
}
catch
(
error
)
{
return
system
.
getResultError
(
"fitaxschemeCtl/insertInfo 新建方案出错!"
);
}
}
}
module
.
exports
=
FitaxschemeCtl
;
tx-fi-tax/app/base/db/impl/bizchance/bizoptDao.js
View file @
fab0d54a
...
...
@@ -20,7 +20,7 @@ class BizoptDao extends Dao {
//不是来自平台前端查询
if
(
qobj
.
bizpath
&&
qobj
.
bizpath
.
indexOf
(
"pmx"
)
<
0
)
{
qc
.
where
.
business_type
=
qc
.
where
.
business_type
||
{
[
this
.
db
.
Op
.
In
]:
[
"
ft
"
]
[
this
.
db
.
Op
.
In
]:
[
"
bookkeeping
"
]
}
// if (qobj.bizpath && qobj.bizpath != "") {
// if (qobj.bizpath.indexOf("myChance") > 0) {//说明是从商机列表过来的
...
...
@@ -41,14 +41,14 @@ class BizoptDao extends Dao {
/*更新商机状态*/
async
updateStatusByDemandCode
(
qobj
,
t
)
{
var
setobj
=
{
"business_status"
:
qobj
.
currentS
tatus
};
if
(
qobj
.
statusReason
&&
qobj
.
statusR
eason
!=
'undefined'
)
{
setobj
[
"close_reason"
]
=
qobj
.
statusR
eason
;
var
setobj
=
{
"business_status"
:
qobj
.
business_s
tatus
};
if
(
qobj
.
close_reason
&&
qobj
.
close_r
eason
!=
'undefined'
)
{
setobj
[
"close_reason"
]
=
qobj
.
close_r
eason
;
}
else
{
setobj
[
"close_reason"
]
=
""
;
}
var
whereobj
=
{
"demand_code"
:
qobj
.
businessM
ode
};
var
whereobj
=
{
"demand_code"
:
qobj
.
demand_c
ode
};
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
}
...
...
tx-fi-tax/app/base/db/impl/bizchance/fitaxcompanyDao.js
View file @
fab0d54a
...
...
@@ -6,16 +6,42 @@ class FitaxcompanyDao extends Dao {
}
/**
*增删改查
*/
/**
* 插入状态信息
* @param {*} qobj
* @param {*} t
*/
async
insertInfo
(
qobj
,
t
){
async
insertInfo
(
qobj
,
t
)
{
let
obj
=
{
"demand_code"
:
qobj
.
demand_code
,
// 需求编码
}
if
(
qobj
.
company_name
)
{
// 企业名称
obj
.
company_name
=
qobj
.
company_name
;
}
if
(
qobj
.
legal_person
)
{
// 法人姓名
obj
.
legal_person
=
qobj
.
legal_person
;
}
if
(
qobj
.
tax_number
)
{
// 税号
obj
.
tax_number
=
qobj
.
tax_number
;
}
if
(
qobj
.
taxpayer_type
)
{
// 纳税人类型
obj
.
taxpayer_type
=
qobj
.
taxpayer_type
;
}
if
(
qobj
.
engaged_industry
)
{
// 所属行业
obj
.
engaged_industry
=
qobj
.
engaged_industry
;
}
if
(
qobj
.
region
)
{
// 地区
obj
.
region
=
qobj
.
region
;
}
if
(
qobj
.
address
)
{
// 企业地址
obj
.
address
=
qobj
.
address
;
}
return
await
this
.
create
(
obj
,
t
);
}
/**
*增删改查
*/
}
module
.
exports
=
FitaxcompanyDao
;
tx-fi-tax/app/base/db/impl/bizchance/fitaxschemeDao.js
View file @
fab0d54a
...
...
@@ -5,17 +5,44 @@ class FitaxschemeDao extends Dao {
super
(
Dao
.
getModelName
(
FitaxschemeDao
));
}
/**
*增删改查
*/
/**
*增删改查
*/
/**
* 插入状态信息
* @param {*} qobj
* @param {*} t
*/
async
insertInfo
(
qobj
,
t
){
async
insertInfo
(
qobj
,
t
)
{
let
obj
=
{
"demand_code"
:
qobj
.
demand_code
,
// 需求编码
}
if
(
qobj
.
solution_bizid
)
{
// 方案编号
obj
.
solution_bizid
=
qobj
.
solution_bizid
;
}
if
(
qobj
.
company_type
)
{
// 公司类型
obj
.
company_type
=
qobj
.
company_type
;
}
if
(
qobj
.
taxpayer_type
)
{
// 纳税人类型
obj
.
taxpayer_type
=
qobj
.
taxpayer_type
;
}
if
(
qobj
.
service_name
)
{
// 服务地区
obj
.
service_name
=
qobj
.
service_name
;
}
if
(
qobj
.
buy_duration
)
{
// 购买时长
obj
.
buy_duration
=
qobj
.
buy_duration
;
}
if
(
qobj
.
number
)
{
// 数量
obj
.
number
=
qobj
.
number
;
}
if
(
qobj
.
total_cost
)
{
// 总计费用
obj
.
total_cost
=
qobj
.
total_cost
;
}
if
(
qobj
.
remarks
)
{
// 备注
obj
.
remarks
=
qobj
.
remarks
;
}
return
await
this
.
create
(
obj
,
t
);
}
}
module
.
exports
=
FitaxschemeDao
;
tx-fi-tax/app/base/db/metadata/app/platform.js
View file @
fab0d54a
...
...
@@ -16,6 +16,15 @@ module.exports = {
"tencentCloud"
:
"腾讯云"
},
"bizoptStatus"
:
{
"pending"
:
"待处理"
,
"beforeFollowUp"
:
"待跟进"
,
"followingUp"
:
"跟进中"
,
"beforeSubmission"
:
"待确认方案"
,
"isFinished"
:
"已完成"
,
"isClosed"
:
"已关闭"
},
"businessType"
:
{
//商机类型
"companyCase"
:
"公司注册"
,
"psCase"
:
"云上园区注册"
,
...
...
tx-fi-tax/app/base/service/impl/bizchance/fitaxcompanySve.js
0 → 100644
View file @
fab0d54a
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
class
FitaxcompanyService
extends
ServiceBase
{
constructor
()
{
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
FitaxcompanyService
));
}
async
findById
(
qobj
){
//根据id获取方案信息
var
oid
=
qobj
.
id
;
return
await
this
.
dao
.
findById
(
oid
);
}
async
findInfoByDemandCode
(
qobj
){
//根据方案编号获取方案详情
return
await
this
.
dao
.
findInfoByDemandCode
(
qobj
);
}
async
updateStatusByDemandCode
(
qobj
){
//根据商机编号号更新方案状态及原因
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateStatusByDemandCode
(
qobj
,
t
);
});
}
async
updateInfoByDemandCode
(
qobj
){
//根据商机编号更新方案详情
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateInfoByDemandCode
(
qobj
,
t
);
});
}
async
updateSchemeNumberByDemandCode
(
qobj
){
//根据商机编号更新方案编号
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateSchemeNumberByDemandCode
(
qobj
,
t
);
});
}
async
insertInfo
(
qobj
){
//插入方案信息
var
self
=
this
;
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
insertInfo
(
qobj
,
t
);
});
}
}
module
.
exports
=
FitaxcompanyService
;
\ No newline at end of file
tx-fi-tax/app/base/service/impl/bizchance/fitaxschemeSve.js
0 → 100644
View file @
fab0d54a
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
class
FitaxschemeService
extends
ServiceBase
{
constructor
()
{
super
(
"bizchance"
,
ServiceBase
.
getDaoName
(
FitaxschemeService
));
}
async
findById
(
qobj
){
//根据id获取方案信息
var
oid
=
qobj
.
id
;
return
await
this
.
dao
.
findById
(
oid
);
}
async
findInfoByDemandCode
(
qobj
){
//根据方案编号获取方案详情
return
await
this
.
dao
.
findInfoByDemandCode
(
qobj
);
}
async
updateStatusByDemandCode
(
qobj
){
//根据商机编号号更新方案状态及原因
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateStatusByDemandCode
(
qobj
,
t
);
});
}
async
updateInfoByDemandCode
(
qobj
){
//根据商机编号更新方案详情
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateInfoByDemandCode
(
qobj
,
t
);
});
}
async
updateSchemeNumberByDemandCode
(
qobj
){
//根据商机编号更新方案编号
var
self
=
this
;
return
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
updateSchemeNumberByDemandCode
(
qobj
,
t
);
});
}
async
insertInfo
(
qobj
){
//插入方案信息
var
self
=
this
;
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
dao
.
insertInfo
(
qobj
,
t
);
});
}
}
module
.
exports
=
FitaxschemeService
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment