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
32ee8847
Commit
32ee8847
authored
Apr 14, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
288118de
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
20 deletions
+117
-20
center-order/app/base/api/impl/opaction/opOrder.js
+14
-2
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+13
-17
center-order/app/base/service/impl/utilsSve/utilsChannelTmDeliverySve.js
+86
-0
center-order/提示编码使用
+4
-1
No files found.
center-order/app/base/api/impl/opaction/opOrder.js
View file @
32ee8847
...
@@ -5,6 +5,7 @@ class OrderAPI extends APIBase {
...
@@ -5,6 +5,7 @@ class OrderAPI extends APIBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
this
.
utilsChannelTmDeliverySve
=
system
.
getObject
(
"service.utilsSve.utilsChannelTmDeliverySve"
);
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
...
@@ -13,8 +14,10 @@ class OrderAPI extends APIBase {
...
@@ -13,8 +14,10 @@ class OrderAPI extends APIBase {
* action_body 执行的参数
* action_body 执行的参数
*/
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
userInfo
)
{
if
([
"addAliChannelTmApplicant"
,
"getAliChannelTmDelivery"
].
indexOf
(
pobj
.
actionType
)
<
0
)
{
return
system
.
getResultFail
(
system
.
noLogin
,
"user no login!"
);
if
(
!
pobj
.
userInfo
)
{
return
system
.
getResultFail
(
system
.
noLogin
,
"user no login!"
);
}
}
}
if
(
!
pobj
.
actionType
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
...
@@ -25,6 +28,15 @@ class OrderAPI extends APIBase {
...
@@ -25,6 +28,15 @@ class OrderAPI extends APIBase {
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"addAliChannelTmApplicant"
:
//新增ali渠道商标交付信息
opResult
=
await
this
.
utilsChannelTmDeliverySve
.
addAliChannelTmApplicant
(
pobj
.
actionBody
);
break
;
case
"updateAliChannelTm"
:
//修改ali渠道商标信息
opResult
=
await
this
.
utilsChannelTmDeliverySve
.
updateAliChannelTm
(
pobj
.
actionBody
);
break
;
case
"getAliChannelTmDelivery"
:
//查询ali渠道商标交付信息
opResult
=
await
this
.
utilsChannelTmDeliverySve
.
getAliChannelTmDelivery
(
pobj
.
actionBody
);
break
;
case
"updateContacts"
:
//修改订单联系人
case
"updateContacts"
:
//修改订单联系人
opResult
=
await
this
.
orderinfoSve
.
updateContacts
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
orderinfoSve
.
updateContacts
(
pobj
,
pobj
.
actionBody
);
break
;
break
;
...
...
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
32ee8847
...
@@ -249,17 +249,19 @@ class OrderInfoService extends ServiceBase {
...
@@ -249,17 +249,19 @@ class OrderInfoService extends ServiceBase {
var
price_item
=
actionBody
.
product_info
.
price_item
;
var
price_item
=
actionBody
.
product_info
.
price_item
;
var
self
=
this
;
var
self
=
this
;
var
extraNclCount
=
0
;
//计算多余的尼斯数量
var
extraNclCount
=
0
;
//计算多余的尼斯数量
var
totalNclPublicExpense
=
0
;
//重新计算尼斯官费
for
(
let
index
=
0
;
index
<
deliveryData
.
nclones
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
deliveryData
.
nclones
.
length
;
index
++
)
{
var
nclThree
=
deliveryData
.
nclones
[
index
].
nclThree
;
var
nclThree
=
deliveryData
.
nclones
[
index
].
nclThree
;
deliveryData
.
nclones
[
index
].
nclCount
=
nclThree
.
length
;
deliveryData
.
nclones
[
index
].
nclCount
=
nclThree
.
length
;
deliveryData
.
nclones
[
index
].
nclPublicExpense
=
Number
(
price_item
.
public_expense
);
deliveryData
.
nclones
[
index
].
nclPublicExpense
=
Number
(
price_item
.
public_expense
);
totalNclPublicExpense
=
totalNclPublicExpense
+
Number
(
price_item
.
public_expense
);
//一个大类的官费
deliveryData
.
nclones
[
index
].
tmStatus
=
deliveryStatus
;
//商标交付状态
deliveryData
.
nclones
[
index
].
tmStatus
=
deliveryStatus
;
//商标交付状态
deliveryData
.
nclones
[
index
].
tmStatusName
=
deliveryStatusName
;
deliveryData
.
nclones
[
index
].
tmStatusName
=
deliveryStatusName
;
deliveryData
.
nclones
[
index
].
submitTime
=
""
;
deliveryData
.
nclones
[
index
].
submitTime
=
""
;
deliveryData
.
nclones
[
index
].
deliveryType
=
pobj
.
appInfo
.
delivery_type
;
//应用数据操作类型:00独立,10全委托
deliveryData
.
nclones
[
index
].
deliveryType
=
pobj
.
appInfo
.
delivery_type
;
//应用数据操作类型:00独立,10全委托
deliveryData
.
nclones
[
index
].
tbCode
=
await
self
.
getBusUid
(
"tb"
+
pobj
.
appInfo
.
uapp_id
);
//提报号(自动生成)
deliveryData
.
nclones
[
index
].
tbCode
=
await
self
.
getBusUid
(
"tb"
+
pobj
.
appInfo
.
uapp_id
);
//提报号(自动生成)
deliveryData
.
nclones
[
index
].
tmRegistNum
=
""
;
deliveryData
.
nclones
[
index
].
tmRegistNum
=
""
;
extraNclCount
=
extraNclCount
+
(
nclThree
.
length
-
1
0
);
extraNclCount
=
extraNclCount
+
(
nclThree
.
length
>
10
?
(
nclThree
.
length
-
10
)
:
0
);
}
}
if
(
extraNclCount
>
0
)
{
if
(
extraNclCount
>
0
)
{
if
(
!
actionBody
.
additions
)
{
if
(
!
actionBody
.
additions
)
{
...
@@ -269,13 +271,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -269,13 +271,7 @@ class OrderInfoService extends ServiceBase {
return
system
.
getResult
(
null
,
"没有查询到附加购买项目信息,20336"
);
return
system
.
getResult
(
null
,
"没有查询到附加购买项目信息,20336"
);
}
}
//重新计算尼斯官费
//重新计算尼斯官费
var
totalNclPublicExpense
=
0
;
totalNclPublicExpense
=
totalNclPublicExpense
+
extraNclCount
*
Number
(
actionBody
.
product_info
.
price_additions_item
.
public_expense
);
for
(
let
g
=
0
;
g
<
deliveryData
.
nclones
.
length
;
g
++
)
{
const
nclThree
=
deliveryData
.
nclones
[
g
].
nclThree
;
var
tmpNclPublicExpense
=
Number
(
deliveryData
.
nclones
[
g
].
nclPublicExpense
)
+
(
nclThree
.
length
-
10
)
*
Number
(
actionBody
.
product_info
.
price_additions_item
.
public_expense
);
totalNclPublicExpense
=
totalNclPublicExpense
+
tmpNclPublicExpense
;
deliveryData
.
nclones
[
g
].
nclPublicExpense
=
tmpNclPublicExpense
;
}
}
}
if
(
Number
(
actionBody
.
totalSum
)
<
Number
(
totalNclPublicExpense
))
{
if
(
Number
(
actionBody
.
totalSum
)
<
Number
(
totalNclPublicExpense
))
{
return
system
.
getResult
(
null
,
"总价有误,总价不能小于"
+
totalNclPublicExpense
+
",20140"
);
return
system
.
getResult
(
null
,
"总价有误,总价不能小于"
+
totalNclPublicExpense
+
",20140"
);
...
@@ -455,6 +451,15 @@ class OrderInfoService extends ServiceBase {
...
@@ -455,6 +451,15 @@ class OrderInfoService extends ServiceBase {
//=================================修改订单信息==============end======================================
//=================================修改订单信息==============end======================================
async
updateContacts
(
pobj
,
actionBody
)
{
//修改订单联系人
async
updateContacts
(
pobj
,
actionBody
)
{
//修改订单联系人
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
orderItem
=
await
this
.
dao
.
getItemStatusByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
var
orderItem
=
await
this
.
dao
.
getItemStatusByOrderNo
(
actionBody
.
orderNo
,
pobj
.
appInfo
.
uapp_id
);
if
(
!
orderItem
)
{
if
(
!
orderItem
)
{
return
system
.
getResult
(
null
,
"修改失败,修改的数据为空,30100"
);
return
system
.
getResult
(
null
,
"修改失败,修改的数据为空,30100"
);
...
@@ -465,15 +470,6 @@ class OrderInfoService extends ServiceBase {
...
@@ -465,15 +470,6 @@ class OrderInfoService extends ServiceBase {
if
(
orderItem
.
orderStatus
==
8
)
{
if
(
orderItem
.
orderStatus
==
8
)
{
return
system
.
getResult
(
null
,
"已完成的订单不能进行修改,30120"
);
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
=
{
var
updateFields
=
{
contactName
:
actionBody
.
orderContact
.
contacts
||
""
,
contactName
:
actionBody
.
orderContact
.
contacts
||
""
,
mobile
:
actionBody
.
orderContact
.
mobile
,
//手机号
mobile
:
actionBody
.
orderContact
.
mobile
,
//手机号
...
...
center-order/app/base/service/impl/utilsSve/utilsChannelTmDeliverySve.js
0 → 100644
View file @
32ee8847
const
system
=
require
(
"../../../system"
);
const
uuidv4
=
require
(
'uuid/v4'
);
//内部通知调用
class
UtilsChannelTmDeliveryService
{
constructor
()
{
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
}
//=================================修改渠道交付信息==============start======================================
async
addAliChannelTmApplicant
(
actionBody
)
{
//新增ali渠道商标交付信息
var
itemResult
=
await
this
.
getChannelDelivery
(
actionBody
.
orderNo
);
if
(
itemResult
.
status
!=
0
)
{
this
.
addChannelDelivery
(
actionBody
.
deliveryData
,
actionBody
.
orderNo
,
actionBody
.
channelOrderNo
)
return
system
.
getResultSuccess
();
}
return
system
.
getResult
(
null
,
"添加失败,已经存在要添加的数据,30240"
);
}
async
updateAliChannelTm
(
actionBody
)
{
//修改ali渠道商标信息
var
itemResult
=
await
this
.
getChannelDelivery
(
actionBody
.
orderNo
);
if
(
itemResult
.
status
!=
0
)
{
return
itemResult
;
}
if
(
!
itemResult
.
data
||
Object
.
keys
(
itemResult
.
data
).
length
==
0
)
{
return
system
.
getResult
(
null
,
"修改失败,修改的数据为空,30230"
);
}
var
apply
=
actionBody
.
apply
;
if
(
apply
)
{
var
dbApply
=
itemResult
.
data
.
apply
;
var
applyKeys
=
Object
.
keys
(
apply
);
if
(
dbApply
&&
applyKeys
.
length
>
0
)
{
for
(
let
index
=
0
;
index
<
applyKeys
.
length
;
index
++
)
{
const
aKey
=
applyKeys
[
index
];
if
(
apply
[
aKey
]
!=
dbApply
[
aKey
])
{
itemResult
.
data
.
apply
[
aKey
]
=
apply
[
aKey
];
}
}
this
.
putChannelDelivery
(
itemResult
.
data
,
actionBody
.
orderNo
);
}
}
var
tmInfo
=
actionBody
.
tm
;
if
(
tmInfo
)
{
itemResult
.
data
.
tm
=
tmInfo
;
this
.
putChannelDelivery
(
itemResult
.
data
,
actionBody
.
orderNo
);
}
}
async
getAliChannelTmDelivery
(
actionBody
)
{
//查询ali渠道商标交付信息
var
itemResult
=
await
this
.
getChannelDelivery
(
actionBody
.
orderNo
);
if
(
itemResult
.
status
!=
0
)
{
return
itemResult
;
}
if
(
!
itemResult
.
data
||
Object
.
keys
(
itemResult
.
data
).
length
==
0
)
{
return
system
.
getResult
(
null
,
"获取失败,数据为空,30233"
);
}
var
returnParam
=
{
apply
:
itemResult
.
data
.
apply
,
channelOrderNo
:
itemResult
.
data
.
channelOrderNo
}
return
system
.
getResultSuccess
(
returnParam
);
}
putChannelDelivery
(
data
,
orderNo
)
{
//修改交付信息--内部调用
var
sql
=
"UPDATE `c_channel_delivery` SET deliveryContent ='"
+
JSON
.
stringify
(
data
)
+
"' where sourceOrderNo='"
+
orderNo
+
"'"
;
this
.
orderinfoDao
.
customQuery
(
sql
);
}
addChannelDelivery
(
data
,
orderNo
,
channelOrderNo
)
{
//新增渠道交付信息--内部调用
var
sql
=
"INSERT INTO `c_channel_delivery` (`sourceOrderNo`,`channelOrderNo`,`deliveryContent`) VALUE('"
+
orderNo
+
"','"
+
channelOrderNo
+
"','"
+
JSON
.
stringify
(
data
)
+
"')"
;
this
.
orderinfoDao
.
customQuery
(
sql
);
}
async
getChannelDelivery
(
orderNo
)
{
//查询渠道交付信息--内部调用
var
sql
=
"select * from c_channel_delivery where sourceOrderNo=:sourceOrderNo"
;
var
paramWhere
=
{
sourceOrderNo
:
orderNo
};
var
list
=
await
this
.
orderinfoDao
.
customQuery
(
sql
,
paramWhere
);
if
(
!
list
||
list
.
length
==
0
||
!
list
[
0
].
deliveryContent
)
{
return
system
.
getResult
(
null
,
"get channel delivery data is empty,30250"
);
}
return
system
.
getResultSuccess
(
list
[
0
].
deliveryContent
);
}
//=================================修改渠道交付信息==============end======================================
}
module
.
exports
=
UtilsChannelTmDeliveryService
;
\ No newline at end of file
center-order/提示编码使用
View file @
32ee8847
已经使用的
编码汇总:
已经使用的
编码汇总:
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
30200
30200
30210
30210
30220
30220
30230
30240
30250
========================================================
========================================================
...
...
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