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
6a1147e8
Commit
6a1147e8
authored
Mar 19, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
修改订单推送信息
parents
b4104a53
3db5b6cc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
259 additions
and
34 deletions
+259
-34
center-order/app/base/api/api.base.js
+1
-1
center-order/app/base/api/impl/action/opNeed.js
+3
-0
center-order/app/base/api/impl/action/qcapi.js
+4
-0
center-order/app/base/api/impl/task/taskAction.js
+33
-23
center-order/app/base/db/impl/dbcorder/orderinfoDao.js
+46
-0
center-order/app/base/db/impl/dbcorder/orderinfofqDao.js
+40
-0
center-order/app/base/db/impl/dbneed/needinfofqDao.js
+4
-0
center-order/app/base/db/models/dbcorder/orderinfo.js
+2
-0
center-order/app/base/db/models/dbcorder/orderinfofq.js
+40
-0
center-order/app/base/db/models/dbneed/needinfofq.js
+3
-3
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+0
-0
center-order/app/base/service/impl/dbneed/needinfoSve2.js
+1
-0
center-order/app/base/service/impl/dbneed/opneedinfoSve.js
+0
-0
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
+42
-0
center-order/app/base/service/impl/qcutils/baseqcSve.js
+40
-7
No files found.
center-order/app/base/api/api.base.js
View file @
6a1147e8
...
...
@@ -28,7 +28,7 @@ class APIBase {
return
system
.
getResultSuccess
();
}
}
if
([
"updateTmStatus"
].
indexOf
(
methodname
)
>=
0
)
{
if
([
"updateTmStatus"
,
"bulkCreateNeeds"
,
"bulkCreateOrders"
].
indexOf
(
methodname
)
>=
0
)
{
return
system
.
getResultSuccess
();
}
if
(
!
pobj
.
appInfo
)
{
...
...
center-order/app/base/api/impl/action/opNeed.js
View file @
6a1147e8
...
...
@@ -48,6 +48,9 @@ class IcAPI extends APIBase {
case
"getStatisticsByProduct"
:
opResult
=
await
this
.
opNeedInfoSve
.
getStatisticsByProduct
(
pobj
);
break
;
case
"getNeedProductType"
:
opResult
=
await
this
.
opNeedInfoSve
.
getNeedProductType
(
pobj
);
break
;
case
"getStatisticsByArea"
:
opResult
=
await
this
.
opNeedInfoSve
.
getStatisticsByCity
(
pobj
);
break
;
...
...
center-order/app/base/api/impl/action/qcapi.js
View file @
6a1147e8
...
...
@@ -131,6 +131,10 @@ class QcAPI extends APIBase {
case
"addIcpSalesmanInfo"
:
//添加业务员信息,用于直接下单的icp订单
opResult
=
await
this
.
baiduqcSve
.
addIcpSalesmanInfo
(
pobj
);
break
;
case
"tmFeedbackSubmit"
:
//商标用户反馈
opResult
=
await
this
.
aliyunqcSve
.
tmFeedbackSubmit
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-order/app/base/api/impl/task/taskAction.js
View file @
6a1147e8
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
//
var system = require("../../../system");
//
var settings = require("../../../../config/settings");
class
TaskAction
extends
APIBase
{
constructor
()
{
super
();
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
this
.
opneedinfoSve
=
system
.
getObject
(
"service.dbneed.opneedinfoSve"
);
this
.
orderproductSve
=
system
.
getObject
(
"service.dbcorder.orderproductSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
taskNeed
(
pobj
,
qobj
,
req
)
{
var
result
=
await
this
.
opneedinfoSve
.
syncNeedBusiness
();
return
result
;
}
async
taskProduct
(
pobj
,
qobj
,
req
)
{
var
result
=
await
this
.
orderproductSve
.
syncProductData
();
return
result
;
}
// constructor() {//由dba进行处理了
// super();
// this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
// this.opneedinfoSve = system.getObject("service.dbneed.opneedinfoSve");
// this.orderproductSve = system.getObject("service.dbcorder.orderproductSve");
// }
// /**
// * 需求商机同步
// * action_process 执行的流程
// * action_type 执行的类型
// * action_body 执行的参数
// */
// async taskNeed(pobj, qobj, req) {
// var result = await this.opneedinfoSve.syncNeedBusiness();
// return result;
// }
//
// async taskProduct(pobj, qobj, req) {
// var result = await this.orderproductSve.syncProductData();
// }
// /**
// * 订单商机同步
// * action_process 执行的流程
// * action_type 执行的类型
// * action_body 执行的参数
// */
// async taskOrder(pobj, qobj, req) {
// var result = await this.orderinfoSve.syncOrderBusiness();
// return result;
// }
}
module
.
exports
=
TaskAction
;
\ No newline at end of file
center-order/app/base/db/impl/dbcorder/orderinfoDao.js
View file @
6a1147e8
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
const
{
Op
}
=
require
(
"sequelize"
);
class
OrderInfoDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
OrderInfoDao
));
...
...
@@ -56,5 +57,50 @@ class OrderInfoDao extends Dao {
await
this
.
customInsert
(
sql
,
null
,
t
);
return
system
.
getResultSuccess
()
}
/**
* 根据ids 获取需求
* @param ids
* @returns {Promise<void>}
*/
async
getOrdersByIds
(
ids
){
let
orders
=
await
this
.
findAll
({
where
:
{
channelOrderNo
:
{
[
Op
.
in
]:
ids
}
}
})
return
orders
;
}
/**
* 批量更新
* @param needs
* @returns {Promise<Array<Model>|*>}
*/
async
bulkUpdate
(
orders
){
let
result
=
await
this
.
bulkCreate
(
orders
,{
fields
:[
"id"
,
"status"
,
"statusName"
]
,
updateOnDuplicate
:
[
"status"
,
"statusName"
]
});
return
result
;
}
/**
* 批量更新
* @param needs
* @returns {Promise<Array<Model>|*>}
*/
async
bulkUpdateStatus
(
status
,
statusName
,
ids
){
let
result
=
await
this
.
updateByWhere
({
orderStatus
:
status
,
orderStatusName
:
statusName
},{
where
:
{
channelOrderNo
:{
[
Op
.
in
]:
ids
}
}
});
return
result
;
}
}
module
.
exports
=
OrderInfoDao
;
center-order/app/base/db/impl/dbcorder/orderinfofqDao.js
0 → 100644
View file @
6a1147e8
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
const
{
Op
}
=
require
(
"sequelize"
);
class
OrderinfofqDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
OrderinfofqDao
));
}
/**
* 取300条未处理的数据
* @returns {Promise<Array<Model>>}
*/
async
getAllOrders
(){
let
fqNeeds
=
await
this
.
findAll
({
where
:
{
handleStatus
:
0
},
order
:
[[
"id"
,
"desc"
]],
limit
:
300
})
return
fqNeeds
;
}
/**
* 批量更新
* @param needs
* @returns {Promise<Array<Model>|*>}
*/
async
bulkUpdate
(
ids
){
let
result
=
await
this
.
updateByWhere
({
handleStatus
:
1
},{
where
:
{
channelOrderNo
:{
[
Op
.
in
]:
ids
}
}
});
return
result
;
}
}
module
.
exports
=
OrderinfofqDao
;
center-order/app/base/db/impl/dbneed/needinfofqDao.js
View file @
6a1147e8
...
...
@@ -6,6 +6,10 @@ class NeedinfofqDao extends Dao {
super
(
Dao
.
getModelName
(
NeedinfofqDao
));
}
/**
* 取300条未处理的数据
* @returns {Promise<Array<Model>>}
*/
async
getAllNeeds
(){
let
fqNeeds
=
await
this
.
findAll
({
where
:
{
...
...
center-order/app/base/db/models/dbcorder/orderinfo.js
View file @
6a1147e8
...
...
@@ -38,6 +38,8 @@ module.exports = (db, DataTypes) => {
opNotes
:
DataTypes
.
STRING
,
// 备注
notes
:
DataTypes
.
STRING
,
// 备注
isSolution
:
DataTypes
.
INTEGER
,
// 是否有方案,0无,1有
isPushNum
:
DataTypes
.
INTEGER
,
// 推送次数
pushStatus
:
DataTypes
.
INTEGER
,
// 推送状态0待推送2推送失败3已成功推送
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
...
...
center-order/app/base/db/models/dbcorder/orderinfofq.js
0 → 100644
View file @
6a1147e8
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"orderinfofq"
,
{
sourceName
:
DataTypes
.
STRING
(
128
),
// 来源名称(source_name)
serviceOrderNo
:
DataTypes
.
STRING
(
128
),
// 服务商订单号(页面中列表中显示该单号)-云服(no)
channelServiceNo
:
DataTypes
.
STRING
(
128
),
// 渠道服务单号
channelOrderNo
:
DataTypes
.
STRING
(
128
),
// 渠道订单号(页面中列表中显示该单号)(idempotent_no)
channelNeedNo
:
DataTypes
.
STRING
(
128
),
// 渠道需求号(页面中列表中显示该需求号)
needNo
:
DataTypes
.
STRING
(
128
),
//需求号(need_no)
payTime
:
DataTypes
.
DATE
,
// 支付时间(first_pay_time)
quantity
:
DataTypes
.
INTEGER
,
// 项目订单数量(即服务项目的倍数,默认值为1)
orderStatusName
:
DataTypes
.
STRING
(
50
),
//订单状态名称
orderStatus
:
DataTypes
.
INTEGER
,
// 订单状态: 1: 待付款, 2: 已付款, 4: 服务中, 8: 已完成, 16: 已退款, 32: 已作废
totalSum
:
DataTypes
.
DECIMAL
(
12
,
2
),
// 订单总额(产品价格×优惠费率×订单件数)
payTotalSum
:
DataTypes
.
DECIMAL
(
12
,
2
),
// 订单付款总额
refundSum
:
DataTypes
.
DECIMAL
(
12
,
2
),
// 退款金额
refundTime
:
DataTypes
.
DATE
,
//2020/6/17 lin新增 退款时间
notes
:
DataTypes
.
STRING
,
// 备注
isSolution
:
DataTypes
.
INTEGER
,
// 是否有方案,0无,1有
handleStatus
:
DataTypes
.
INTEGER
,
// 处理状态,0否,1是
source_code
:
DataTypes
.
STRING
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updated_at
:
true
,
// 2020 0618 lin修改
//freezeTableName: true,
// define the table's name
tableName
:
'c_order_info_fq'
,
validate
:
{
},
indexes
:
[
]
});
}
center-order/app/base/db/models/dbneed/needinfofq.js
View file @
6a1147e8
...
...
@@ -5,10 +5,10 @@ module.exports = (db, DataTypes) => {
return
db
.
define
(
"needinfofq"
,
{
sourceCode
:
DataTypes
.
STRING
(
128
),
//来源code )idempotent_source
channelNeedNo
:
DataTypes
.
STRING
(
128
),
//渠道需求号(页面中列表中显示该需求号)
publishContent
:
DataTypes
.
STRING
,
//发布内容
publishContent
:
DataTypes
.
TEXT
,
//发布内容
publishMobile
:
DataTypes
.
STRING
,
//发布者手机号
followContent
:
DataTypes
.
JSON
,
//跟进内容
notes
:
DataTypes
.
STRING
,
//备注
followContent
:
DataTypes
.
TEXT
,
//跟进内容
notes
:
DataTypes
.
TEXT
,
//备注
disposeNotes
:
DataTypes
.
STRING
,
//处理的备注
statusName
:
DataTypes
.
STRING
,
status
:
DataTypes
.
INTEGER
,
...
...
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
6a1147e8
This diff is collapsed.
Click to expand it.
center-order/app/base/service/impl/dbneed/needinfoSve2.js
View file @
6a1147e8
...
...
@@ -184,6 +184,7 @@ class NeedinfoService2 extends ServiceBase {
}
async
writeCommunicationLog
(
pobj
,
actionBody
)
{
console
.
log
(
'actionBody---writeCommunicationLog---'
,
actionBody
)
// 查询需求沟通记录
// 2020 0820 lin 修改channel传过来的参数 为 note/intentionBizId
actionBody
.
Note
=
[
"noteTime"
,
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
),
"note"
,
actionBody
.
note
];
...
...
center-order/app/base/service/impl/dbneed/opneedinfoSve.js
View file @
6a1147e8
This diff is collapsed.
Click to expand it.
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
View file @
6a1147e8
...
...
@@ -841,6 +841,48 @@ class AliyunQcService {
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
return
system
.
getResultSuccess
(
needinfo
);
}
//接收tm用户方案反馈
async
tmFeedbackSubmit
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
intentionBizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道需求编号错误"
);
}
if
(
!
ab
.
description
)
{
return
system
.
getResultFail
(
-
102
,
"问题描述不能为空"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
},
raw
:
true
});
if
(
!
needinfo
)
{
return
system
.
getResultFail
(
-
104
,
"未知方案需求"
);
}
if
(
needinfo
.
status
==
"ygb"
)
{
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
)
{
return
system
.
getResultSuccess
();
}
var
intentionStatusList
=
[
"未知"
,
"⽅案待服务商确认"
,
"⽅案待⽤户确认"
,
"处理中"
,
"已完成"
,
"已关闭"
];
var
updateObj
=
{
id
:
ns
.
id
};
var
solutionContent
=
ns
.
solutionContent
;
solutionContent
.
customerRemark
=
ab
.
description
;
solutionContent
.
needStatus
=
1
;
updateObj
[
"status"
]
=
"ybh"
;
solutionContent
.
needStatusName
=
intentionStatusList
[
ab
.
intentionStatus
];
solutionContent
=
JSON
.
stringify
(
solutionContent
);
updateObj
[
"solutionContent"
]
=
solutionContent
;
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
return
system
.
getResultSuccess
(
needinfo
);
}
//接收方案编号(方案推送至阿里后,接收保存方案信息)
async
receiveProgrammeNo
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
...
...
center-order/app/base/service/impl/qcutils/baseqcSve.js
View file @
6a1147e8
...
...
@@ -40,6 +40,9 @@ class BaseQcService {
107
:
"管局已受理"
};
this
.
icpApplicationStatusReference
=
{
504
:
"创建交付订单"
,
505
:
"资料收集完成"
,
506
:
"资料加工完成"
,
507
:
"完成账户注册"
,
508
:
"服务商完成提交资料到⼯信部"
,
509
:
"⼯信部已受理"
,
...
...
@@ -231,12 +234,28 @@ class BaseQcService {
if
(
!
solution
)
{
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
}
if
(
needinfo
.
channelTypeCode
==
"7"
)
{
//edi
ab
.
solutionContent
.
solution
.
IcpType
=
2
;
}
else
if
(
needinfo
.
channelTypeCode
==
"5"
)
{
//icp
ab
.
solutionContent
.
solution
.
IcpType
=
1
;
}
else
{
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误"
);
//判断属于百度还是易名
if
(
needinfo
.
uapp_id
==
44
){
if
(
needinfo
.
channelTypeCode
==
"7"
)
{
//edi
ab
.
solutionContent
.
solution
.
IcpType
=
2
;
}
else
if
(
needinfo
.
channelTypeCode
==
"5"
)
{
//icp
ab
.
solutionContent
.
solution
.
IcpType
=
1
;
}
else
{
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误"
);
}
}
if
(
needinfo
.
uapp_id
==
52
){
if
(
needinfo
.
channelTypeCode
==
"7"
)
{
//edi
ab
.
solutionContent
.
solution
.
IcpType
=
2
;
}
else
if
(
needinfo
.
channelTypeCode
==
"5"
)
{
//icp
ab
.
solutionContent
.
solution
.
IcpType
=
1
;
}
else
if
(
needinfo
.
channelTypeCode
==
"icpnb"
)
{
//icpnb
ab
.
solutionContent
.
solution
.
IcpType
=
4
;
}
else
if
(
needinfo
.
channelTypeCode
==
"edinb"
)
{
//edinb
ab
.
solutionContent
.
solution
.
IcpType
=
3
;
}
else
{
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误"
);
}
}
if
(
!
solution
.
CompanyName
)
{
return
system
.
getResultFail
(
-
105
,
"公司名不能为空"
);
...
...
@@ -529,6 +548,16 @@ class BaseQcService {
if
(
ab
.
officialFileURL
)
{
ab
[
"OfficialFileURL"
]
=
ab
.
officialFileURL
;
}
//2021-3-18 addNew
if
(
ab
.
officialFileURL
)
{
ab
[
"CertificateNumber"
]
=
ab
.
certificateNumber
;
}
if
(
ab
.
officialFileURL
)
{
ab
[
"CertificateStartTime"
]
=
ab
.
certificateStartTime
;
}
if
(
ab
.
officialFileURL
)
{
ab
[
"CertificateEndTime"
]
=
ab
.
certificateEndTime
;
}
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
...
...
@@ -694,7 +723,11 @@ class BaseQcService {
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"created_at"
:
new
Date
()
"created_at"
:
new
Date
(),
//2021-3-18 addNew
"CertificateNumber"
:
ab
.
CertificateNumber
||
""
,
//证书编号
"CertificateStartTime"
:
ab
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
"CertificateEndTime"
:
ab
.
CertificateEndTime
||
""
//证书有效期 结束时间
};
applicationStatusList
.
push
(
statusObj
);
solutionContent
.
applicationStatusList
=
applicationStatusList
;
...
...
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