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
75dd282d
Commit
75dd282d
authored
Dec 24, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
0f4e118b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
160 deletions
+28
-160
center-order/app/base/db/impl/reg/regcenterorderDao.js
+0
-76
center-order/app/base/db/models/reg/regcenterorder.js
+0
-56
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
+28
-28
No files found.
center-order/app/base/db/impl/reg/regcenterorderDao.js
deleted
100644 → 0
View file @
0f4e118b
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
RegCenterorderDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
RegCenterorderDao
));
}
async
getItemByNeedNo
(
needNo
)
{
return
await
this
.
model
.
findOne
({
where
:
{
needNo
:
needNo
},
attributes
:
[
"id"
,
"uapp_id"
,
"needNo"
,
"channelNeedNo"
,
"channelUserId"
,
"followManUserId"
,
"followManMobile"
,
"city"
,
"province"
,
"publishContent"
,
"publishName"
,
"publishMobile"
,
"notes"
,
"followContent"
,
"disposeNotes"
,
"status"
,
"statusName"
,
"typeCode"
,
"typeName"
,
"channelTypeCode"
,
"channelTypeName"
,
"publisherOnlyCode"
,
"followManName"
,
"followManOnlyCode"
,
"created_at"
],
raw
:
true
});
}
async
getItemByChannelNeedNo
(
channelNeedNo
)
{
return
await
this
.
model
.
findOne
({
where
:
{
channelNeedNo
:
channelNeedNo
},
attributes
:
[
"id"
,
"uapp_id"
,
"needNo"
,
"channelNeedNo"
,
"channelUserId"
,
"followManUserId"
,
"followManMobile"
,
"city"
,
"province"
,
"publishContent"
,
"publishName"
,
"publishMobile"
,
"notes"
,
"followContent"
,
"disposeNotes"
,
"status"
,
"typeCode"
,
"typeName"
,
"channelTypeCode"
,
"channelTypeName"
,
"publisherOnlyCode"
,
"followManName"
,
"followManOnlyCode"
,
"created_at"
],
raw
:
true
});
}
}
module
.
exports
=
RegCenterorderDao
;
center-order/app/base/db/models/reg/regcenterorder.js
deleted
100644 → 0
View file @
0f4e118b
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"regcenterorder"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
channelNeedNo
:
DataTypes
.
STRING
(
128
),
//渠道需求号(页面中列表中显示该需求号)
needNo
:
DataTypes
.
STRING
(
128
),
//需求号--用于服务商或需求表中创建订单
channelUserId
:
DataTypes
.
INTEGER
,
//发布者id
publishName
:
DataTypes
.
STRING
,
//发布者姓名
publisherOnlyCode
:
DataTypes
.
STRING
(
50
),
//发布者唯一码
publishContent
:
DataTypes
.
STRING
,
//发布内容
publishMobile
:
DataTypes
.
STRING
,
//发布者手机号
followManUserId
:
DataTypes
.
INTEGER
,
//跟进人id
followManName
:
DataTypes
.
STRING
,
//跟进人姓名
followManMobile
:
DataTypes
.
STRING
,
//跟进人手机号(合伙人)
followManOnlyCode
:
DataTypes
.
STRING
(
50
),
//跟进者唯一码
followContent
:
DataTypes
.
JSON
,
//跟进内容
productOneType_id
:
DataTypes
.
STRING
,
//产品大类Id
productType_id
:
DataTypes
.
STRING
,
//产品类型Id
notes
:
DataTypes
.
STRING
,
//备注
disposeNotes
:
DataTypes
.
STRING
,
//处理的备注
statusName
:
DataTypes
.
STRING
,
status
:
{
//wts未推送,yts已推送,ygj已跟进,ycd已成单
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
push_chance_type
),
set
:
function
(
val
)
{
this
.
setDataValue
(
"status"
,
val
);
this
.
setDataValue
(
"statusName"
,
uiconfig
.
config
.
pdict
.
push_chance_type
[
val
]);
}
},
city
:
DataTypes
.
STRING
(
50
),
// 城市
province
:
DataTypes
.
STRING
(
50
),
// 省份
typeCode
:
DataTypes
.
STRING
(
50
),
//产品类型编码',
typeName
:
DataTypes
.
STRING
(
50
),
//类型产品名称',
channelTypeCode
:
DataTypes
.
STRING
(
50
),
//渠道产品类型编码',
channelTypeName
:
DataTypes
.
STRING
(
255
),
//渠道产品类型名称',
level
:
DataTypes
.
STRING
(
20
),
//商机等级
probability
:
DataTypes
.
STRING
(
20
),
//商机概率
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'n_need_info'
,
validate
:
{
},
indexes
:
[
]
});
}
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
View file @
75dd282d
//工商注册
const
system
=
require
(
"../../../system"
);
const
moment
=
require
(
'moment'
);
const
ServiceBase
=
require
(
"../../sve.base"
);
class
RegCenterOrderService
extends
ServiceBase
{
class
RegCenterOrderService
{
constructor
()
{
super
(
"reg"
,
ServiceBase
.
getDaoName
(
RegCenterOrderService
));
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
...
...
@@ -43,9 +41,10 @@ class RegCenterOrderService extends ServiceBase {
if
(
!
actionBody
.
type
)
{
return
system
.
getResultFail
(
-
5003
,
"type不能为空"
);
}
var
ninfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
if
(
ninfo
)
{
return
system
.
getResultSuccess
(
ninfo
);
var
needInfo
=
await
this
.
needinfoDao
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
console
.
log
(
'needInfo---'
,
needInfo
)
if
(
needInfo
)
{
return
system
.
getResultSuccess
(
needInfo
);
}
var
nobj
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
...
...
@@ -69,7 +68,7 @@ class RegCenterOrderService extends ServiceBase {
// if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
// nobj.province = nobj.city, nobj.city = "";
// }
var
needInfo
=
await
this
.
d
ao
.
create
(
nobj
);
var
needInfo
=
await
this
.
needinfoD
ao
.
create
(
nobj
);
return
system
.
getResultSuccess
(
needInfo
);
}
...
...
@@ -185,27 +184,28 @@ class RegCenterOrderService extends ServiceBase {
//渠道方案号获取需求详情
async
getItemByChannelSolutionNo
(
pobj
)
{
var
i
=
0
;
var
bizIdLength
=
pobj
.
actionBody
.
length
;
var
bizIdList
=
[];
for
(
i
=
0
;
i
<=
bizIdLength
;
i
++
)
{
bizIdList
.
push
(
pobj
.
actionBody
[
i
].
bizId
)
}
bizIdListStr
=
bizIdList
.
join
(
","
);
// var solutionitem = await this.needsolutionDao.findOne({ channelSolutionNo: pobj.actionBody.bizId });
var
sql
=
"select * from n_need_solution where channelSolutionNo in ("
+
bizIdListStr
+
")"
;
var
solutionitem
=
await
this
.
customQuery
(
sql
);
if
(
solutionitem
.
length
<
1
)
{
console
.
log
(
'getItemByChannelSolutionNo---'
,
pobj
)
// var i = 0;
// var bizIdLength = pobj.actionBody.length;
// var bizIdList = [];
// for (i = 0; i <= bizIdLength; i++) {
// bizIdList.push(pobj.actionBody[i].bizId)
// }
// bizIdListStr = bizIdList.join(",");
var
solutionitem
=
await
this
.
needsolutionDao
.
findOne
({
channelSolutionNo
:
pobj
.
actionBody
.
bizId
});
// var sql = "select * from n_need_solution where channelSolutionNo in (" + bizIdListStr + ")";
// var solutionitem = await this.customQuery(sql);
if
(
!
solutionitem
)
{
return
system
.
getResult
(
null
,
"方案数据为空,30210"
);
}
var
item
=
await
this
.
dao
.
getItemByNeedNo
(
solutionitem
[
0
]
.
needNo
);
var
item
=
await
this
.
needinfoDao
.
getItemByNeedNo
(
solutionitem
.
needNo
);
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"需求数据为空,30210"
);
}
item
.
solutionProvince
=
solutionitem
[
0
].
solutionContent
.
solution
.
Area
||
solutionitem
[
0
]
.
solutionContent
.
solution
.
area
;
item
.
solutionContent
=
solutionitem
[
0
]
.
solutionContent
item
.
channelSolutionNo
=
solutionitem
[
0
]
.
channelSolutionNo
item
.
solutionProvince
=
solutionitem
.
solutionContent
.
solution
.
Area
||
solutionitem
.
solutionContent
.
solution
.
area
;
item
.
solutionContent
=
solutionitem
.
solutionContent
item
.
channelSolutionNo
=
solutionitem
.
channelSolutionNo
return
system
.
getResultSuccess
(
item
);
}
...
...
@@ -347,7 +347,7 @@ class RegCenterOrderService extends ServiceBase {
return
system
.
getResultFail
(
-
101
,
"渠道方案编号不能为空"
);
}
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
){
//直接下单
var
oldNs
=
await
this
.
d
ao
.
model
.
findOne
({
var
oldNs
=
await
this
.
orderinfoD
ao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
});
var
newNsObj
=
{
...
...
@@ -388,14 +388,14 @@ class RegCenterOrderService extends ServiceBase {
if
(
oldNs
&&
oldNs
.
id
){
ns
=
oldNs
;
}
else
{
ns
=
await
this
.
d
ao
.
create
(
newNsObj
);
ns
=
await
this
.
needsolutionD
ao
.
create
(
newNsObj
);
}
var
ns2
=
await
this
.
d
ao
.
model
.
findOne
({
var
ns2
=
await
this
.
needsolutionD
ao
.
model
.
findOne
({
where
:
{
id
:
ns
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns2
);
}
else
{
var
needsolutioninfo
=
await
this
.
d
ao
.
model
.
findOne
({
var
needsolutioninfo
=
await
this
.
needsolutionD
ao
.
model
.
findOne
({
attributes
:[
"id"
,
"solutionContent"
,
"status"
,
"orderNo"
],
where
:
{
channelSolutionNo
:
ab
.
channelSolutionNo
,
isInvalid
:
0
},
raw
:
true
});
...
...
@@ -416,8 +416,8 @@ class RegCenterOrderService extends ServiceBase {
needsolutioninfo
.
status
=
"ywc"
;
}
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
await
this
.
d
ao
.
update
(
needsolutioninfo
);
var
ns
=
await
this
.
d
ao
.
model
.
findOne
({
await
this
.
needsolutionD
ao
.
update
(
needsolutioninfo
);
var
ns
=
await
this
.
needsolutionD
ao
.
model
.
findOne
({
where
:
{
id
:
needsolutioninfo
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
...
...
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