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
373ff7af
Commit
373ff7af
authored
Mar 01, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order
parents
ac2fb22c
5e14e691
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
415 additions
and
39 deletions
+415
-39
center-order/app/base/api/api.base.js
+6
-0
center-order/app/base/api/impl/action/order.js
+6
-6
center-order/app/base/api/impl/action/policy.js
+6
-0
center-order/app/base/api/impl/opaction/opOrder.js
+42
-0
center-order/app/base/db/impl/dbcorder/ordercontactsDao.js
+15
-0
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+172
-29
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+1
-2
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
+116
-0
center-order/app/base/service/impl/dbpolicy/policysubscribeSve.js
+21
-2
center-order/提示编码使用
+30
-0
No files found.
center-order/app/base/api/api.base.js
View file @
373ff7af
...
@@ -14,6 +14,12 @@ class APIBase {
...
@@ -14,6 +14,12 @@ class APIBase {
return
u
;
return
u
;
}
}
async
checkAcck
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
async
checkAcck
(
gname
,
methodname
,
pobj
,
query
,
req
)
{
if
(
methodname
.
length
>
4
)
{
var
prefixStr
=
methodname
.
substr
(
0
,
4
);
if
(
prefixStr
==
"task"
)
{
return
system
.
getResultSuccess
();
}
}
if
(
!
pobj
.
appInfo
)
{
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !!"
);
return
system
.
getResult
(
null
,
"pobj.appInfo can not be empty !!"
);
}
}
...
...
center-order/app/base/api/impl/action/order.js
View file @
373ff7af
...
@@ -61,7 +61,7 @@ class OrderAPI extends APIBase {
...
@@ -61,7 +61,7 @@ class OrderAPI extends APIBase {
async
addOrder
(
pobj
,
actionBody
)
{
async
addOrder
(
pobj
,
actionBody
)
{
if
(
!
actionBody
.
product_info
)
{
if
(
!
actionBody
.
product_info
)
{
return
system
.
getResult
(
null
,
"产品信息有误,200
1
0"
);
return
system
.
getResult
(
null
,
"产品信息有误,200
0
0"
);
}
}
var
interface_info
=
null
;
var
interface_info
=
null
;
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
...
@@ -80,13 +80,13 @@ class OrderAPI extends APIBase {
...
@@ -80,13 +80,13 @@ class OrderAPI extends APIBase {
}
//使用默认的其他订单
}
//使用默认的其他订单
if
(
!
interface_info
)
{
if
(
!
interface_info
)
{
return
system
.
getResult
(
null
,
"产品接口信息有误,200
3
0"
);
return
system
.
getResult
(
null
,
"产品接口信息有误,200
1
0"
);
}
}
if
(
!
interface_info
.
interface_type
)
{
if
(
!
interface_info
.
interface_type
)
{
return
system
.
getResult
(
null
,
"产品接口类型信息有误,200
5
0"
);
return
system
.
getResult
(
null
,
"产品接口类型信息有误,200
2
0"
);
}
}
if
(
!
interface_info
.
interface_url
)
{
if
(
!
interface_info
.
interface_url
)
{
return
system
.
getResult
(
null
,
"产品接口地址信息有误,200
8
0"
);
return
system
.
getResult
(
null
,
"产品接口地址信息有误,200
3
0"
);
}
}
var
refOpResult
=
await
this
.
reflexAction
(
interface_info
,
pobj
);
var
refOpResult
=
await
this
.
reflexAction
(
interface_info
,
pobj
);
return
refOpResult
;
return
refOpResult
;
...
@@ -95,11 +95,11 @@ class OrderAPI extends APIBase {
...
@@ -95,11 +95,11 @@ class OrderAPI extends APIBase {
var
refResult
=
null
;
var
refResult
=
null
;
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
!
interface_info
.
method_name
)
{
if
(
!
interface_info
.
method_name
)
{
return
system
.
getResult
(
null
,
"产品接口参数信息有误,20
11
0"
);
return
system
.
getResult
(
null
,
"产品接口参数信息有误,20
04
0"
);
}
//操作的方法名称
}
//操作的方法名称
var
invokeObj
=
system
.
getObject
(
interface_info
.
interface_url
);
var
invokeObj
=
system
.
getObject
(
interface_info
.
interface_url
);
if
(
!
invokeObj
[
interface_info
.
method_name
])
{
if
(
!
invokeObj
[
interface_info
.
method_name
])
{
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,20
13
0"
);
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,20
05
0"
);
}
}
pobj
.
interface_params
=
interface_info
.
params
;
pobj
.
interface_params
=
interface_info
.
params
;
var
params
=
[
pobj
];
var
params
=
[
pobj
];
...
...
center-order/app/base/api/impl/action/policy.js
View file @
373ff7af
...
@@ -68,6 +68,12 @@ class PolicyAPI extends APIBase {
...
@@ -68,6 +68,12 @@ class PolicyAPI extends APIBase {
case
"policySubscribeQuery"
:
//政策订阅检索列表(通过订阅信息查询订阅的政策信息)
case
"policySubscribeQuery"
:
//政策订阅检索列表(通过订阅信息查询订阅的政策信息)
opResult
=
this
.
policysubscribeSve
.
policySubscribeQuery
(
pobj
);
opResult
=
this
.
policysubscribeSve
.
policySubscribeQuery
(
pobj
);
break
;
break
;
case
"getPolicyBusinessFq"
:
//政策商机(蜂擎)
opResult
=
this
.
policyneedSve
.
getPolicyBusinessFq
(
pobj
);
break
;
case
"getPolicyNeedInfo"
:
//政策需求信息(icompany)
opResult
=
this
.
policyneedSve
.
getPolicyNeedInfo
(
pobj
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-order/app/base/api/impl/opaction/opOrder.js
0 → 100644
View file @
373ff7af
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
OrderAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
userInfo
)
{
return
system
.
getResultFail
(
system
.
noLogin
,
"user no login!"
);
}
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"updateContacts"
:
//修改订单联系人
opResult
=
await
this
.
orderinfoSve
.
updateContacts
(
pobj
,
pobj
.
actionBody
);
break
;
case
"updateTmOrder"
:
//修改商标订单信息
opResult
=
await
this
.
orderinfoSve
.
updateTmOrder
(
pobj
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
OrderAPI
;
\ No newline at end of file
center-order/app/base/db/impl/dbcorder/ordercontactsDao.js
View file @
373ff7af
...
@@ -4,5 +4,20 @@ class OrderContactsDao extends Dao {
...
@@ -4,5 +4,20 @@ class OrderContactsDao extends Dao {
constructor
()
{
constructor
()
{
super
(
Dao
.
getModelName
(
OrderContactsDao
));
super
(
Dao
.
getModelName
(
OrderContactsDao
));
}
}
async
getItemByOrderNo
(
orderNo
,
uapp_id
)
{
return
await
this
.
model
.
findOne
({
where
:
{
sourceOrderNo
:
orderNo
},
attributes
:
[
"id"
,
"contactName"
,
"mobile"
,
"tel"
,
"email"
,
"fax"
],
raw
:
true
});
}
}
}
module
.
exports
=
OrderContactsDao
;
module
.
exports
=
OrderContactsDao
;
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
373ff7af
...
@@ -12,6 +12,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -12,6 +12,7 @@ class OrderInfoService extends ServiceBase {
this
.
moneyJourneyDao
=
system
.
getObject
(
"db.dbcpay.moneyjourneyDao"
);
this
.
moneyJourneyDao
=
system
.
getObject
(
"db.dbcpay.moneyjourneyDao"
);
}
}
//----------------------订单创建-----------start----------------
async
createOrder
(
pobj
,
orderNo
,
t
)
{
async
createOrder
(
pobj
,
orderNo
,
t
)
{
var
actionBody
=
pobj
.
actionBody
;
var
actionBody
=
pobj
.
actionBody
;
var
channelOrder
=
actionBody
.
channelOrder
;
var
channelOrder
=
actionBody
.
channelOrder
;
...
@@ -115,7 +116,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -115,7 +116,7 @@ class OrderInfoService extends ServiceBase {
var
customerContactObj
=
{
var
customerContactObj
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
//int(11) //
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
//int(11) //
sourceOrderNo
:
orderNo
,
//交付订单号
sourceOrderNo
:
orderNo
,
//交付订单号
contact
s
:
orderContact
.
contacts
||
""
,
//手机号
contact
Name
:
orderContact
.
contacts
||
""
,
//手机号
mobile
:
orderContact
.
mobile
,
//手机号
mobile
:
orderContact
.
mobile
,
//手机号
email
:
orderContact
.
email
||
""
email
:
orderContact
.
email
||
""
};
};
...
@@ -147,10 +148,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -147,10 +148,7 @@ class OrderInfoService extends ServiceBase {
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
var
orderNo
=
await
self
.
getBusUid
(
"tm"
+
pobj
.
appInfo
.
uapp_id
);
var
orderNo
=
await
self
.
getBusUid
(
"tm"
+
pobj
.
appInfo
.
uapp_id
);
var
item
=
await
self
.
createOrder
(
pobj
,
orderNo
,
t
);
var
item
=
await
self
.
createOrder
(
pobj
,
orderNo
,
t
);
var
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
self
.
addOrderDelivery
(
pobj
.
actionBody
.
deliveryData
,
orderNo
);
orderNo
+
"','"
+
JSON
.
stringify
(
pobj
.
actionBody
.
deliveryData
)
+
"')"
;
self
.
customQuery
(
sql
);
return
system
.
getResultSuccess
({
return
system
.
getResultSuccess
({
orderNo
:
orderNo
,
orderNo
:
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
...
@@ -220,20 +218,24 @@ class OrderInfoService extends ServiceBase {
...
@@ -220,20 +218,24 @@ class OrderInfoService extends ServiceBase {
nclThree
:
nclThree
,
nclThree
:
nclThree
,
nclCount
:
nclThree
.
length
,
nclCount
:
nclThree
.
length
,
nclPublicExpense
:
Number
(
price_item
.
price
)
*
nclThree
.
length
,
nclPublicExpense
:
Number
(
price_item
.
price
)
*
nclThree
.
length
,
delivery
Status
:
deliveryStatus
,
//商标交付状态
tm
Status
:
deliveryStatus
,
//商标交付状态
delivery
StatusName
:
deliveryStatusName
,
tm
StatusName
:
deliveryStatusName
,
submitTime
:
""
,
submitTime
:
""
,
deliveryType
:
pobj
.
appInfo
.
delivery_type
,
//应用数据操作类型:00独立,10全委托
deliveryType
:
pobj
.
appInfo
.
delivery_type
,
//应用数据操作类型:00独立,10全委托
tbCode
:
await
self
.
getBusUid
(
"tb"
+
pobj
.
appInfo
.
uapp_id
)
//提报号(自动生成)
tbCode
:
await
self
.
getBusUid
(
"tb"
+
pobj
.
appInfo
.
uapp_id
)
//提报号(自动生成)
}
}
nclList
.
push
(
tempNclones
);
nclList
.
push
(
tempNclones
);
}
}
pobj
.
actionBody
.
deliveryData
.
deliveryStatus
=
deliveryStatus
;
pobj
.
actionBody
.
deliveryData
.
deliveryStatusName
=
deliveryStatusName
;
pobj
.
actionBody
.
deliveryData
.
notes
=
actionBody
.
notes
||
""
;
// 订单备注
pobj
.
actionBody
.
deliveryData
.
opNotes
=
""
;
//操作备注
pobj
.
actionBody
.
deliveryData
.
nclList
=
nclList
;
pobj
.
actionBody
.
deliveryData
.
nclList
=
nclList
;
delete
pobj
.
actionBody
.
deliveryData
[
"nclones"
];
delete
pobj
.
actionBody
.
deliveryData
[
"nclones"
];
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
// caseService 拟开展服务项目 多 必
// caseService 拟开展服务项目 多 必
// caseCustomerType 目标用户 多 必
// caseCustomerType 目标用户 多 必
// caseProfitType 盈利模式 多 必
// caseProfitType 盈利模式 多 必
// caseApprovalProgram 需专项审批的项目 多
// caseApprovalProgram 需专项审批的项目 多
...
@@ -318,21 +320,12 @@ class OrderInfoService extends ServiceBase {
...
@@ -318,21 +320,12 @@ class OrderInfoService extends ServiceBase {
// }
// }
var
self
=
this
;
var
self
=
this
;
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
var
sql
=
""
;
var
orderNo
=
""
;
if
(
pobj
.
actionBody
.
orderNo
)
{
if
(
pobj
.
actionBody
.
orderNo
)
{
orderNo
=
pobj
.
actionBody
.
orderNo
;
self
.
putOrderDelivery
(
pobj
.
actionBody
.
deliveryData
,
pobj
.
actionBody
.
orderNo
);
sql
=
"update c_order_delivery set deliveryContent='"
+
JSON
.
stringify
(
pobj
.
actionBody
.
deliveryData
)
+
"' where sourceOrderNo='"
+
orderNo
+
"'"
;
}
else
{
}
else
{
var
orderNo
=
await
self
.
getBusUid
(
"icp"
+
pobj
.
appInfo
.
uapp_id
);
var
orderNo
=
await
self
.
getBusUid
(
"icp"
+
pobj
.
appInfo
.
uapp_id
);
var
item
=
await
self
.
createOrder
(
pobj
,
orderNo
,
t
);
self
.
addOrderDelivery
(
pobj
.
actionBody
.
deliveryData
,
orderNo
);
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
orderNo
+
"','"
+
JSON
.
stringify
(
pobj
.
actionBody
.
deliveryData
)
+
"')"
;
}
}
self
.
customQuery
(
sql
);
return
system
.
getResultSuccess
({
return
system
.
getResultSuccess
({
orderNo
:
orderNo
,
orderNo
:
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
...
@@ -444,6 +437,144 @@ class OrderInfoService extends ServiceBase {
...
@@ -444,6 +437,144 @@ class OrderInfoService extends ServiceBase {
// return system.getResultFail(2, "订单已存在", beforeOrder.orderNo);
// return system.getResultFail(2, "订单已存在", beforeOrder.orderNo);
// }
// }
}
}
//----------------------订单创建-----------end----------------------
//=================================修改订单信息==============end======================================
async
updateContacts
(
pobj
,
actionBody
)
{
//修改订单联系人
var
orderItem
=
await
this
.
dao
.
getItemStatusByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
if
(
!
orderItem
)
{
return
system
.
getResult
(
null
,
"修改失败,修改的数据为空,30100"
);
}
if
(
orderItem
.
orderStatus
==
4
)
{
return
system
.
getResult
(
null
,
"服务中的订单不能进行修改,30110"
);
}
if
(
orderItem
.
orderStatus
==
8
)
{
return
system
.
getResult
(
null
,
"已完成的订单不能进行修改,30120"
);
}
if
(
!
actionBody
.
orderContact
)
{
return
system
.
getResult
(
null
,
"联系人信息不能为空,30130"
);
}
if
(
!
actionBody
.
orderContact
.
contacts
)
{
return
system
.
getResult
(
null
,
"联系人不能为空,30140"
);
}
if
(
!
actionBody
.
orderContact
.
mobile
)
{
return
system
.
getResult
(
null
,
"手机号不能为空,30150"
);
}
var
updateFields
=
{
contactName
:
actionBody
.
orderContact
.
contacts
||
""
,
mobile
:
actionBody
.
orderContact
.
mobile
,
//手机号
email
:
actionBody
.
orderContact
.
email
||
""
};
this
.
ordercontactsDao
.
updateByWhere
(
updateFields
,
{
where
:
{
sourceOrderNo
:
actionBody
.
orderNo
}
});
if
(
actionBody
.
notes
)
{
actionBody
.
isGetContact
=
0
;
var
itemResult
=
await
this
.
getOrderDeliveryInfo
(
pobj
,
actionBody
);
if
(
itemResult
.
status
==
0
)
{
if
(
actionBody
.
notes
!=
itemResult
.
data
.
notes
)
{
itemResult
.
data
.
notes
=
actionBody
.
notes
;
this
.
putOrderDelivery
(
itemResult
.
data
,
actionBody
.
orderNo
);
}
}
}
//修改备注
return
system
.
getResultSuccess
();
}
async
updateTmOrder
(
pobj
,
actionBody
)
{
//修改商标订单信息
var
orderItem
=
await
this
.
dao
.
getItemStatusByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
if
(
!
orderItem
)
{
return
system
.
getResult
(
null
,
"修改失败,修改的数据为空,30100"
);
}
if
(
orderItem
.
orderStatus
==
4
)
{
return
system
.
getResult
(
null
,
"服务中的订单不能进行修改,30110"
);
}
if
(
orderItem
.
orderStatus
==
8
)
{
return
system
.
getResult
(
null
,
"已完成的订单不能进行修改,30120"
);
}
actionBody
.
isGetContact
=
0
;
var
itemResult
=
await
this
.
getOrderDeliveryInfo
(
pobj
,
actionBody
);
if
(
itemResult
.
status
!=
0
)
{
return
itemResult
;
}
if
(
!
itemResult
.
data
||
Object
.
keys
(
itemResult
.
data
).
length
==
0
)
{
return
system
.
getResult
(
null
,
"修改失败,修改的数据为空,30020"
);
}
var
tipsMsg
=
""
;
var
apply
=
actionBody
.
apply
;
if
(
apply
)
{
var
dbApply
=
itemResult
.
data
.
apply
;
var
applyKeys
=
Object
.
keys
(
apply
);
if
(
apply
&&
dbApply
&&
applyKeys
.
length
>
0
)
{
for
(
let
index
=
0
;
index
<
applyKeys
.
length
;
index
++
)
{
const
aKey
=
applyKeys
[
index
];
if
(
apply
[
aKey
]
&&
apply
[
aKey
]
!=
dbApply
[
aKey
])
{
itemResult
.
data
.
apply
[
aKey
]
=
apply
[
aKey
];
}
}
}
}
var
tm
=
actionBody
.
tm
;
if
(
tm
)
{
var
dbTm
=
itemResult
.
data
.
tm
;
var
tmKeys
=
Object
.
keys
(
tm
);
if
(
tm
&&
dbTm
&&
tmKeys
.
length
>
0
)
{
for
(
let
index
=
0
;
index
<
tmKeys
.
length
;
index
++
)
{
const
aKey
=
tmKeys
[
index
];
if
(
!
tm
[
aKey
])
{
tipsMsg
=
"修改失败,"
+
aKey
+
"不能为空,30030"
;
}
if
(
tm
[
aKey
]
&&
tm
[
aKey
]
!=
dbTm
[
aKey
])
{
itemResult
.
data
.
tm
[
aKey
]
=
tm
[
aKey
];
}
}
}
}
if
(
tipsMsg
)
{
return
system
.
getResult
(
null
,
tipsMsg
);
}
var
nclThree
=
actionBody
.
nclThree
;
if
(
nclThree
&&
nclThree
.
length
>
0
)
{
var
dbNclList
=
itemResult
.
data
.
nclList
;
if
(
!
actionBody
.
tbCode
)
{
return
system
.
getResult
(
null
,
"修改失败,tbCode不能为空,30040"
);
}
if
(
!
actionBody
.
ncloneCode
)
{
return
system
.
getResult
(
null
,
"修改失败,ncloneCode不能为空,30050"
);
}
if
(
!
actionBody
.
ncloneName
)
{
return
system
.
getResult
(
null
,
"修改失败,ncloneName不能为空,30060"
);
}
var
dataIndex
=
dbNclList
.
findIndex
(
f
=>
f
.
tbCode
==
actionBody
.
tbCode
);
if
(
dataIndex
<
0
)
{
return
system
.
getResult
(
null
,
"修改失败,tbCode有误,30070"
);
}
var
putItemData
=
dbNclList
[
dataIndex
];
if
(
putItemData
.
nclThree
.
length
<
nclThree
.
length
)
{
return
system
.
getResult
(
null
,
"尼斯小项数量有误,数量应小于等于"
+
putItemData
.
nclThree
.
length
+
",30080"
);
}
itemResult
.
data
.
nclList
[
dataIndex
].
nclThree
=
nclThree
;
itemResult
.
data
.
nclList
[
dataIndex
].
ncloneCode
=
actionBody
.
ncloneCode
;
itemResult
.
data
.
nclList
[
dataIndex
].
ncloneName
=
actionBody
.
ncloneName
;
itemResult
.
data
.
nclList
[
dataIndex
].
nclCount
=
nclThree
.
length
;
}
this
.
putOrderDelivery
(
itemResult
.
data
,
actionBody
.
orderNo
);
return
system
.
getResultSuccess
();
}
putOrderDelivery
(
data
,
orderNo
)
{
//修改交付信息
var
sql
=
"UPDATE `c_order_delivery` SET deliveryContent ='"
+
JSON
.
stringify
(
data
)
+
"' where sourceOrderNo='"
+
orderNo
+
"'"
;
this
.
customQuery
(
sql
);
}
addOrderDelivery
(
data
,
orderNo
)
{
//新增交付信息
var
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
orderNo
+
"','"
+
JSON
.
stringify
(
data
)
+
"')"
;
this
.
customQuery
(
sql
);
}
//=================================修改订单信息==============end======================================
/**
/**
* 获取付款订单信息
* 获取付款订单信息
* @param {*} pobj
* @param {*} pobj
...
@@ -452,11 +583,11 @@ class OrderInfoService extends ServiceBase {
...
@@ -452,11 +583,11 @@ class OrderInfoService extends ServiceBase {
async
getPayOrderInfo
(
pobj
,
actionBody
)
{
async
getPayOrderInfo
(
pobj
,
actionBody
)
{
var
productItem
=
await
this
.
orderproductDao
.
getItemByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
var
productItem
=
await
this
.
orderproductDao
.
getItemByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
if
(
!
productItem
)
{
if
(
!
productItem
)
{
return
system
.
getResult
(
null
,
"订单产品数据异常,300
5
0"
);
return
system
.
getResult
(
null
,
"订单产品数据异常,300
9
0"
);
}
}
var
item
=
await
this
.
orderReceiptVoucherDao
.
getItemByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
var
item
=
await
this
.
orderReceiptVoucherDao
.
getItemByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
if
(
!
item
)
{
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"订单已经付款成功,请勿重复支付,300
1
0"
);
return
system
.
getResult
(
null
,
"订单已经付款成功,请勿重复支付,300
0
0"
);
}
}
var
param
=
{
var
param
=
{
receiptVoucher
:
item
,
receiptVoucher
:
item
,
...
@@ -477,6 +608,8 @@ class OrderInfoService extends ServiceBase {
...
@@ -477,6 +608,8 @@ class OrderInfoService extends ServiceBase {
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//**************************************获取订单信息**********start**************************************
async
getOrderInfo
(
pobj
,
actionBody
)
{
//获取订单列表信息
async
getOrderInfo
(
pobj
,
actionBody
)
{
//获取订单列表信息
var
pageSize
=
Number
(
actionBody
.
pageSize
||
20
);
var
pageSize
=
Number
(
actionBody
.
pageSize
||
20
);
if
(
pageSize
>
50
)
{
if
(
pageSize
>
50
)
{
...
@@ -532,29 +665,36 @@ class OrderInfoService extends ServiceBase {
...
@@ -532,29 +665,36 @@ class OrderInfoService extends ServiceBase {
return
result
;
return
result
;
}
}
async
getOrderDeliveryInfo
(
pobj
,
actionBody
)
{
//获取订单交付信息
async
getOrderDeliveryInfo
(
pobj
,
actionBody
)
{
//获取订单交付信息
var
sql
=
"select * from c_order_delivery where sourceOrderNo=:sourceOrderNo"
;
var
sql
=
"select * from c_order_delivery where sourceOrderNo=:sourceOrderNo"
;
var
paramWhere
=
{
sourceOrderNo
:
actionBody
.
orderNo
};
var
paramWhere
=
{
sourceOrderNo
:
actionBody
.
orderNo
};
var
list
=
await
this
.
customQuery
(
sql
,
paramWhere
);
var
list
=
await
this
.
customQuery
(
sql
,
paramWhere
);
var
result
=
system
.
getResultSuccess
();
if
(
list
&&
list
.
length
>
0
)
{
if
(
list
&&
list
.
length
>
0
)
{
if
(
list
[
0
].
deliveryContent
)
{
if
(
list
[
0
].
deliveryContent
)
{
re
turn
system
.
getResultSuccess
(
list
[
0
].
deliveryContent
)
;
re
sult
.
data
=
list
[
0
].
deliveryContent
;
}
}
}
}
return
system
.
getResultSuccess
();
result
.
data
.
orderContact
=
null
;
if
(
!
actionBody
.
isGetContact
)
{
var
item
=
await
this
.
ordercontactsDao
.
getItemByOrderNo
(
actionBody
.
orderNo
);
if
(
item
)
{
result
.
data
.
orderContact
=
item
;
}
}
//是否获取联系人,isGetContact有值则不获取
return
result
;
}
}
async
getOrderDeliveryFlowInfo
(
pobj
,
actionBody
)
{
//获取订单交付流程信息
async
getOrderDeliveryFlowInfo
(
pobj
,
actionBody
)
{
//获取订单交付流程信息
var
sql
=
"select * from c_delivery_official_flow where sourceOrderNo=:sourceOrderNo"
;
var
sql
=
"select * from c_delivery_official_flow where sourceOrderNo=:sourceOrderNo"
;
var
paramWhere
=
{
sourceOrderNo
:
actionBody
.
sourceOrderNo
};
var
paramWhere
=
{
sourceOrderNo
:
actionBody
.
sourceOrderNo
};
var
list
=
await
this
.
customQuery
(
sql
,
paramWhere
);
var
list
=
await
this
.
customQuery
(
sql
,
paramWhere
);
var
result
=
system
.
getResultSuccess
();
if
(
list
&&
list
.
length
>
0
)
{
if
(
list
&&
list
.
length
>
0
)
{
if
(
list
[
0
].
officialFlow
)
{
if
(
list
[
0
].
officialFlow
)
{
re
turn
system
.
getResultSuccess
(
list
[
0
].
officialFlow
)
;
re
sult
.
data
=
list
[
0
].
officialFlow
;
}
}
}
}
return
system
.
getResultSuccess
()
;
return
result
;
}
}
async
getOrderDeliveryFlowList
(
pobj
,
actionBody
)
{
//获取订单交付流程列表信息
async
getOrderDeliveryFlowList
(
pobj
,
actionBody
)
{
//获取订单交付流程列表信息
var
sql
=
"select * from c_delivery_official_flow where sourceOrderNo IN(:sourceOrderNo)"
;
var
sql
=
"select * from c_delivery_official_flow where sourceOrderNo IN(:sourceOrderNo)"
;
...
@@ -578,6 +718,9 @@ class OrderInfoService extends ServiceBase {
...
@@ -578,6 +718,9 @@ class OrderInfoService extends ServiceBase {
var
list
=
await
this
.
flowlogDao
.
getlogListBySourceOrderNo
(
actionBody
.
sourceOrderNo
);
var
list
=
await
this
.
flowlogDao
.
getlogListBySourceOrderNo
(
actionBody
.
sourceOrderNo
);
return
system
.
getResultSuccess
(
list
);
return
system
.
getResultSuccess
(
list
);
}
}
//**************************************/获取订单信息**********end**************************************
//-------------------------------服务商通知订单流程-------------start----------------
//-------------------------------服务商通知订单流程-------------start----------------
async
icOrderStatusNotify
(
pobj
,
actionBody
)
{
//峰擎通知工商办理状态
async
icOrderStatusNotify
(
pobj
,
actionBody
)
{
//峰擎通知工商办理状态
...
@@ -585,7 +728,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -585,7 +728,7 @@ class OrderInfoService extends ServiceBase {
if
(
!
item
)
{
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"order data is empty!"
);
return
system
.
getResult
(
null
,
"order data is empty!"
);
}
}
if
(
Number
(
item
.
orderStatus
)
==
1
)
{
if
(
item
.
orderStatus
==
1
)
{
return
system
.
getResult
(
null
,
"order status is unpay!"
);
return
system
.
getResult
(
null
,
"order status is unpay!"
);
}
}
var
updateDeliveryInfo
=
{
var
updateDeliveryInfo
=
{
...
@@ -615,7 +758,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -615,7 +758,7 @@ class OrderInfoService extends ServiceBase {
updateDeliveryInfo
.
updated
=
actionBody
.
updated
;
updateDeliveryInfo
.
updated
=
actionBody
.
updated
;
updateDeliveryInfo
.
orderDeliveryStatus
=
actionBody
.
orderDeliveryStatus
;
updateDeliveryInfo
.
orderDeliveryStatus
=
actionBody
.
orderDeliveryStatus
;
var
tempList
=
actionBody
.
orderDeliveryStatusName
.
split
(
'-'
);
var
tempList
=
actionBody
.
orderDeliveryStatusName
.
split
(
'-'
);
updateDeliveryInfo
.
orderDeliveryStatusName
=
tempList
[
tempList
.
length
-
1
];
updateDeliveryInfo
.
orderDeliveryStatusName
=
tempList
[
tempList
.
l
修改
ength
-
1
];
var
dataIndex
=
updateDeliveryInfo
.
flowList
.
findIndex
(
f
=>
f
.
orderDeliveryStatus
==
actionBody
.
orderDeliveryStatus
);
var
dataIndex
=
updateDeliveryInfo
.
flowList
.
findIndex
(
f
=>
f
.
orderDeliveryStatus
==
actionBody
.
orderDeliveryStatus
);
if
(
dataIndex
>
-
1
)
{
if
(
dataIndex
>
-
1
)
{
...
...
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
View file @
373ff7af
...
@@ -110,11 +110,10 @@ class PolicyinfoService extends ServiceBase {
...
@@ -110,11 +110,10 @@ class PolicyinfoService extends ServiceBase {
}
}
async
addPolicyByExcel
(){
async
addPolicyByExcel
(){
var
workbook
=
xl
.
readFile
(
"policy
7.xlsx
"
);
var
workbook
=
xl
.
readFile
(
"policy
8.xls
"
);
const
sheetNames
=
workbook
.
SheetNames
;
// 返回 ['sheet1', 'sheet2']
const
sheetNames
=
workbook
.
SheetNames
;
// 返回 ['sheet1', 'sheet2']
const
worksheet
=
workbook
.
Sheets
[
sheetNames
[
0
]];
const
worksheet
=
workbook
.
Sheets
[
sheetNames
[
0
]];
var
dataa
=
xl
.
utils
.
sheet_to_json
(
worksheet
);
var
dataa
=
xl
.
utils
.
sheet_to_json
(
worksheet
);
var
arr
=
[];
var
arr
=
[];
var
that
=
this
;
var
that
=
this
;
await
this
.
db
.
transaction
(
async
function
(
t
)
{
await
this
.
db
.
transaction
(
async
function
(
t
)
{
...
...
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
373ff7af
...
@@ -164,5 +164,121 @@ class PolicyneedService extends ServiceBase {
...
@@ -164,5 +164,121 @@ class PolicyneedService extends ServiceBase {
var
newPolicyNeed
=
await
this
.
dao
.
update
(
paramObj
);
var
newPolicyNeed
=
await
this
.
dao
.
update
(
paramObj
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//政策商机(蜂擎)
async
getPolicyBusinessFq
(
pobj
){
var
app
=
pobj
.
appInfo
;
var
obj
=
pobj
.
actionBody
||
{};
var
pageSize
=
Number
(
obj
.
pageSize
||
20
);
var
pageIndex
=
Number
(
obj
.
pageIndex
||
1
);
var
from
=
pageIndex
==
1
?
0
:
Number
((
pageIndex
-
1
)
*
pageSize
);
if
(
pageSize
>
200
)
{
pageSize
=
200
;
}
var
sql
=
"select need.created_at,need.region,need.mobile,need.industry,need.contacts,policy.policyNo,policy.policyName,policy.policyType,policy.policyTypeName,"
+
"need.company,need.popularizeUserCode,policy.policyLinkUrl,policy.policyProvince from "
+
"(select created_at,id,contacts,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where 1=1 "
;
var
sqlCount
=
"select count(1) as dataCount from "
+
"(select created_at,id,contacts,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where 1=1 "
;
if
(
obj
.
salesmanMobile
){
sql
=
sql
+
" and popularizeUserCode='"
+
obj
.
salesmanMobile
+
"' "
;
sqlCount
=
sqlCount
+
" and popularizeUserCode='"
+
obj
.
salesmanMobile
+
"' "
;
}
sql
=
sql
+
" ) as need "
+
"LEFT JOIN "
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"policyDate,policyProvince,policyCity from b_policy_info) as policy "
+
"on need.policy_id=policy.id where 1=1 "
;
sqlCount
=
sqlCount
+
" ) as need "
+
"LEFT JOIN "
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"policyDate,policyProvince,policyCity from b_policy_info) as policy "
+
"on need.policy_id=policy.id where 1=1 "
;
if
(
obj
.
policyName
){
sql
=
sql
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
sqlCount
=
sqlCount
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
}
if
(
obj
.
policyProvince
){
sql
=
sql
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
sqlCount
=
sqlCount
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
if
(
obj
.
policyCity
){
sql
=
sql
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
sqlCount
=
sqlCount
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
}
}
if
(
obj
.
policyType
){
sql
=
sql
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
sqlCount
=
sqlCount
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
}
if
(
obj
.
customerIntention
){
sql
=
sql
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
sqlCount
=
sqlCount
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
}
if
(
obj
.
startDate
){
sql
=
sql
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
}
if
(
obj
.
endDate
){
sql
=
sql
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
}
sql
=
sql
+
" order by need.id desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
console
.
log
(
sql
);
var
tmpResult
=
await
this
.
customQuery
(
sql
,{});
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,{});
var
result
=
system
.
getResultSuccess
(
tmpResult
);
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
return
result
;
}
//政策需求信息(icompany)
async
getPolicyNeedInfo
(
pobj
){
var
obj
=
pobj
.
actionBody
||
{};
var
pageSize
=
Number
(
obj
.
pageSize
||
20
);
var
pageIndex
=
Number
(
obj
.
pageIndex
||
1
);
var
from
=
pageIndex
==
1
?
0
:
Number
((
pageIndex
-
1
)
*
pageSize
);
if
(
pageSize
>
200
)
{
pageSize
=
200
;
}
var
sql
=
"select contacts,company,industry,region,mobile,created_at "
+
"from b_policy_need where 1=1 "
;
var
sqlCount
=
"select count(1) as dataCount from b_policy_need where 1=1 "
;
if
(
obj
.
contacts
){
sql
=
sql
+
" and contacts = '"
+
obj
.
contacts
+
"'"
;
sqlCount
=
sqlCount
+
" and contacts = '"
+
obj
.
contacts
+
"'"
;
}
if
(
obj
.
mobile
){
sql
=
sql
+
" and mobile = '"
+
obj
.
mobile
+
"'"
;
sqlCount
=
sqlCount
+
" and mobile = '"
+
obj
.
mobile
+
"'"
;
}
if
(
obj
.
industry
){
sql
=
sql
+
" and industry = '"
+
obj
.
industry
+
"'"
;
sqlCount
=
sqlCount
+
" and industry = '"
+
obj
.
industry
+
"'"
;
}
if
(
obj
.
region
){
sql
=
sql
+
" and region = '"
+
obj
.
region
+
"'"
;
sqlCount
=
sqlCount
+
" and region = '"
+
obj
.
region
+
"'"
;
}
if
(
obj
.
company
){
sql
=
sql
+
" and company = '"
+
obj
.
company
+
"'"
;
sqlCount
=
sqlCount
+
" and company = '"
+
obj
.
company
+
"'"
;
}
if
(
obj
.
startDate
){
sql
=
sql
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
}
if
(
obj
.
endDate
){
sql
=
sql
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
}
sql
=
sql
+
" order by created_at desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
console
.
log
(
sql
);
var
tmpResult
=
await
this
.
customQuery
(
sql
,{});
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,{});
var
result
=
system
.
getResultSuccess
(
tmpResult
);
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
return
result
;
}
}
}
module
.
exports
=
PolicyneedService
;
module
.
exports
=
PolicyneedService
;
center-order/app/base/service/impl/dbpolicy/policysubscribeSve.js
View file @
373ff7af
...
@@ -112,6 +112,8 @@ class PolicysubscribeService extends ServiceBase {
...
@@ -112,6 +112,8 @@ class PolicysubscribeService extends ServiceBase {
if
(
!
obj
.
policySubscribeId
){
if
(
!
obj
.
policySubscribeId
){
return
system
.
getResult
(
null
,
"policySubscribeId不能为空"
);
return
system
.
getResult
(
null
,
"policySubscribeId不能为空"
);
}
}
var
currentPage
=
obj
.
currentPage
||
1
;
var
pageSize
=
obj
.
pageSize
||
100
;
var
ps
=
await
this
.
dao
.
model
.
findOne
({
var
ps
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
obj
.
policySubscribeId
,
openid
:
obj
.
openid
},
where
:{
id
:
obj
.
policySubscribeId
,
openid
:
obj
.
openid
},
raw
:
true
raw
:
true
...
@@ -135,10 +137,27 @@ class PolicysubscribeService extends ServiceBase {
...
@@ -135,10 +137,27 @@ class PolicysubscribeService extends ServiceBase {
}
}
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
order
:[[
"id"
,
"DESC"
]]
order
:[[
"id"
,
"DESC"
]],
offset
:(
currentPage
-
1
)
*
pageSize
,
limit
:
pageSize
});
if
(
!
pis
||
pis
.
length
<
1
){
delete
whereObj
[
"created_at"
];
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
order
:[[
"id"
,
"DESC"
]],
offset
:(
currentPage
-
1
)
*
pageSize
,
limit
:
pageSize
});
}
var
picount
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
where
:
whereObj
,
raw
:
true
,
attributes
:[
"id"
],
});
});
picount
=
picount
.
length
;
var
res
=
system
.
getResultSuccess
(
pis
);
res
.
dataCount
=
picount
;
await
this
.
dao
.
update
({
id
:
obj
.
policySubscribeId
,
releaseDate
:
new
Date
()});
//修改订阅发布日期
await
this
.
dao
.
update
({
id
:
obj
.
policySubscribeId
,
releaseDate
:
new
Date
()});
//修改订阅发布日期
return
system
.
getResultSuccess
(
pis
)
;
return
res
;
}
}
}
}
...
...
center-order/提示编码使用
0 → 100644
View file @
373ff7af
已经使用的编码汇总:
已经使用的编码汇总:
1.对订单操作修改
30000
30010
30020
30030
30040
30050
30060
30070
30080
30090
30100
30110
30120
30130
30140
30150
========================================================
2.添加订单操作
20000
20010
20020
20030
20040
20050
\ 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