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
bf4c109f
Commit
bf4c109f
authored
Nov 10, 2019
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
otp
parent
33fd64f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
196 additions
and
3 deletions
+196
-3
igirl-channel/app/base/service/impl/dborder/ordertmproductSve.js
+196
-3
No files found.
igirl-channel/app/base/service/impl/dborder/ordertmproductSve.js
View file @
bf4c109f
...
...
@@ -14,7 +14,7 @@ class OrderTmProductService extends ServiceBase {
this
.
trademarkDao
=
system
.
getObject
(
"db.dbtrademark.trademarkDao"
);
this
.
receiptvoucherDao
=
system
.
getObject
(
"db.dborder.receiptvoucherDao"
);
this
.
tmofficialDao
=
system
.
getObject
(
"db.dbtrademark.tmofficialDao"
);
this
.
userDao
=
system
.
getObject
(
"db.dbapp.appuserDao"
);
}
...
...
@@ -265,7 +265,11 @@ class OrderTmProductService extends ServiceBase {
orderObj
.
deliveryStatus
=
"dsh"
;
}
}
var
customer
=
await
this
.
customerinfoDao
.
findOneByCodeAndUserId
(
apply
.
code
,
user
.
id
);
//查询客户档案
// var customer = await this.customerinfoDao.findOneByCodeAndUserId(apply.code, user.id);//查询客户档案
var
customer
=
await
this
.
customerinfoDao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
orderObj
.
deliveryOrderNo
},
raw
:
true
});
if
(
customer
&&
customer
.
id
)
{
//客户已存在 则更新
customerInfoObj
[
"id"
]
=
customer
.
id
;
await
this
.
customerinfoDao
.
update
(
customerInfoObj
,
t
);
...
...
@@ -283,7 +287,11 @@ class OrderTmProductService extends ServiceBase {
fax
:
apply
.
fax
//传真
};
var
customercontacts
=
await
this
.
customercontactsDao
.
findOneByMobile
(
apply
.
mobile
,
customer
.
id
);
// var customercontacts = await this.customercontactsDao.findOneByMobile(apply.mobile, customer.id);
var
customercontacts
=
await
this
.
customercontactsDao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
orderObj
.
deliveryOrderNo
},
raw
:
true
});
if
(
!
customercontacts
)
{
//客户联系人不存在 则创建
customercontacts
=
await
this
.
customercontactsDao
.
create
(
customerContactObj
,
t
);
//创建订单联系人
}
...
...
@@ -303,6 +311,9 @@ class OrderTmProductService extends ServiceBase {
for
(
var
i
=
0
;
i
<
nclones
.
length
;
i
++
)
{
var
tbcode
=
await
self
.
getBusUid
(
"tb"
);
var
nclone
=
nclones
[
i
];
if
(
nclone
.
tbCode
){
//用于辅助注册推送数据
tbcode
=
nclone
.
tbCode
;
}
var
nclthreeobj
=
nclone
.
nclThree
;
var
nclthreeobjCount
=
nclone
.
nclThree
.
length
;
//计算尼斯小类官方总额
...
...
@@ -565,6 +576,188 @@ class OrderTmProductService extends ServiceBase {
}
return
system
.
getResultSuccess
(
resultData
);
}
//-------------------------接收辅助注册商标数据-------start--------------------------------------------------------
/**
* 接收辅助注册商标数据
*/
async
addAssistTm
(
params
){
// return system.getResultSuccess(null, "接口开发中");
var
self
=
this
;
var
itemCode
=
params
.
itemCode
;
//产品编码
var
tm
=
params
.
tm
;
//增加sourceType || "00";//来源类型:00订单,10需求,20服务商
var
apply
=
params
.
apply
;
var
app
=
params
.
app
;
var
user
=
params
.
user
;
var
nclones
=
params
.
nclones
||
null
;
var
channelOrder
=
params
.
channelOrder
||
null
;
var
orderType
=
params
.
orderType
||
"dkxd"
;
//订单类型,zzdd: 自主订单,dkxd: 代客下单
var
needNo
=
"ztest512021303d1"
;
//channelOrder.needNo;
if
(
!
needNo
)
{
return
system
.
getResult
(
null
,
"需求编号不能为空"
);
}
var
order
=
await
this
.
orderDao
.
model
.
findOne
({
where
:{
needNo
:
needNo
},
raw
:
true
});
if
(
!
order
||
!
order
.
id
){
return
system
.
getResult
(
null
,
"未知订单"
);
}
//获取渠道用户数据
var
channelUser
=
await
this
.
userDao
.
model
.
findOne
({
where
:{
channelUserId
:
order
.
channelUserId
,
app_id
:
order
.
app_id
},
raw
:
true
,
attributes
:[
"id"
,
"app_id"
,
"channelUserId"
,
"channelUserName"
,
"userMoblie"
,
"nickname"
]
});
channelOrder
[
"channelServiceNo"
]
=
order
.
channelServiceNo
;
channelOrder
[
"payTime"
]
=
order
.
payTime
;
if
(
channelUser
&&
channelUser
.
userMobile
){
channelUser
[
"channelUserMobile"
]
=
channelUser
.
userMobile
;
}
if
(
!
nclones
||
nclones
.
length
<
1
)
{
return
system
.
getResult
(
null
,
"尼斯大类不能为空"
);
}
if
(
!
itemCode
)
{
return
system
.
getResult
(
null
,
"itemCode参数错误"
);
}
itemCode
=
"zzsbzc"
;
//测试
var
productItem
=
await
this
.
appproductDao
.
findOneByCode
(
itemCode
,
1
);
//获取产品
if
(
!
productItem
)
{
return
system
.
getResult
(
null
,
"未知的产品"
);
}
if
(
productItem
.
status
!=
1
)
{
return
system
.
getResult
(
null
,
"产品已禁用"
);
}
if
(
productItem
&&
productItem
.
verifyPrice
==
1
)
{
var
verifyResult
=
await
self
.
isOrderVerify
(
user
,
1
,
tm
,
productItem
,
nclones
,
null
);
if
(
verifyResult
)
{
return
verifyResult
;
}
}
else
{
tm
.
nclOneCodes
=
[];
tm
.
nclCount
=
0
;
for
(
var
i
=
0
;
i
<
nclones
.
length
;
i
++
)
{
var
nclone
=
nclones
[
i
];
var
nclthreeobj
=
nclone
.
nclThree
;
if
(
nclone
)
{
tm
.
nclOneCodes
.
push
(
nclone
.
code
);
tm
.
nclCount
=
tm
.
nclCount
+
nclthreeobj
.
length
;
}
}
}
if
(
tm
.
tmFormType
==
"4"
)
{
//图形商标
tm
[
"name"
]
=
"图形"
;
}
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
//创建订单
var
ordercode
=
await
self
.
getBusUid
(
"tm"
);
if
(
order
.
orderNo
){
ordercode
=
order
.
orderNo
;
}
var
orderAmount
=
tm
;
orderAmount
.
salesNum
=
tm
.
nclOneCodes
.
length
;
orderAmount
.
minitermNum
=
tm
.
nclCount
;
// var orderResult = await self.orderDao.addOrder(ordercode, orderType, user, app, productItem, channelOrder, channelUser, apply, orderAmount, t);
// if (orderResult.status != 0) {
// return orderResult;
// }
// var order = orderResult.data;
var
jfcode
=
await
self
.
getBusUid
(
"jf"
);
var
orderProductObj
=
{
app_id
:
user
.
app_id
,
//
productType_id
:
productItem
.
picUrl
,
//产品类型Id
productOneType_id
:
productItem
.
picUrl
,
//产品大类Id
itemCode
:
productItem
.
itemCode
,
//
itemName
:
productItem
.
itemName
,
//
tmName
:
tm
.
tmName
,
//商标名称
tmType
:
"p"
,
//"p": "普通商标", "j": "集体商标", "z": "证明商标", "t": "特殊商标"
tmFormType
:
tm
.
tmFormType
,
//商标类型形式:"1": "立体", "3": "字", "4": "图", "5": "字图", "6": "颜色", "7": "彩色"
nclOneCodes
:
tm
.
nclOneCodes
?
tm
.
nclOneCodes
.
join
(
","
)
:
null
,
//尼斯大类列表:格式以,隔开
orderServicePayStatus
:
channelOrder
.
payStatus
,
//支付状态:dfk: 待付款, yfk: 已支付
deliveryStatus
:
"dsccl"
,
//商标交付状态:dsccl: 待上传材料, dsh: 待审核, ddj: 待递交, ywc: 已完成
appDataOpType
:
app
.
appDataOpType
,
// 应用数据操作类型:00独立,10全委托,20部分委托
sourceOrderNo
:
ordercode
,
//来源单号
deliveryOrderNo
:
channelOrder
.
deliveryOrderNo
||
jfcode
,
channelServiceNo
:
channelOrder
.
channelServiceNo
,
// 渠道服务单号
channelOrderNo
:
channelOrder
.
channelOrderNo
,
//渠道订单号列表,多个以,隔开
needNo
:
channelOrder
.
needNo
||
null
,
//需求单号
sourceType
:
order
.
sourceType
||
"00"
,
picUrl
:
tm
.
picUrl
||
null
,
//商标图样
colorizedPicUrl
:
tm
.
colorizedPicUrl
||
null
,
//商标彩色图样
sywjUrl
:
tm
.
sywjUrl
||
null
,
//声音文件
gzwtsUrl
:
tm
.
gzwtsUrl
||
null
,
//盖章委托书
smwjUrl
:
tm
.
smwjUrl
||
null
,
//说明文件
channelUserId
:
channelUser
.
channelUserId
,
// 渠道用户id
createuser_id
:
user
.
id
,
//
createuser
:
user
.
nickname
,
//
notes
:
tm
.
notes
||
""
,
// 备注信息
nclOneCount
:
tm
.
nclOneCodes
.
length
,
nclCount
:
tm
.
nclCount
,
};
var
flowContent
=
""
;
if
(
apply
.
customerType
==
"person"
)
{
if
(
!
apply
.
businessLicensePic
||
!
apply
.
identityCardPic
||
!
tm
.
gzwtsUrl
)
{
orderProductObj
[
"deliveryStatus"
]
=
"dsccl"
;
flowContent
=
channelOrder
.
payStatus
==
"yfk"
?
"订单已付款待上传材料"
:
"订单已创建待付款"
;
}
else
{
orderProductObj
[
"deliveryStatus"
]
=
"dsh"
;
flowContent
=
channelOrder
.
payStatus
==
"yfk"
?
"订单已付款待审核"
:
"订单已创建待付款"
;
}
}
if
(
apply
.
customerType
==
"ent"
)
{
if
(
!
apply
.
businessLicensePic
||
!
tm
.
gzwtsUrl
)
{
orderProductObj
[
"deliveryStatus"
]
=
"dsccl"
;
flowContent
=
channelOrder
.
payStatus
==
"yfk"
?
"订单已付款待上传材料"
:
"订单已创建待付款"
;
}
else
{
orderProductObj
[
"deliveryStatus"
]
=
"dsh"
;
flowContent
=
channelOrder
.
payStatus
==
"yfk"
?
"订单已付款待审核"
:
"订单已创建待付款"
;
}
}
//订单客户档案添加和修改
await
self
.
opCustomerInfo
(
user
,
apply
,
orderProductObj
,
t
);
//获取历史交付单信息
var
beforeOtp
=
await
self
.
ordertmproductDao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
channelOrder
.
deliveryOrderNo
},
raw
:
true
});
var
orderTm
=
null
;
if
(
beforeOtp
&&
beforeOtp
.
id
){
//更新交付单
orderProductObj
[
"id"
]
=
beforeOtp
.
id
;
await
self
.
dao
.
update
(
orderProductObj
,
t
);
orderTm
=
await
self
.
ordertmproductDao
.
model
.
findOne
({
where
:{
id
:
beforeOtp
.
id
},
raw
:
true
});
}
else
{
//创建服务单
orderTm
=
await
self
.
dao
.
create
(
orderProductObj
,
t
);
//创建商标订单
}
var
flowObj
=
{
app_id
:
user
.
app_id
,
createuser_id
:
user
.
id
,
sourceOrderNo
:
ordercode
,
opContent
:
flowContent
};
await
self
.
orderflowDao
.
create
(
flowObj
,
t
);
//创建订单流程
flowObj
.
sourceOrderNo
=
orderProductObj
.
deliveryOrderNo
;
await
self
.
orderflowDao
.
create
(
flowObj
,
t
);
//创建交付流程
orderTm
.
needNo
=
channelOrder
.
needNo
||
null
;
//需求单号
var
returnTm
=
await
self
.
opTmInfo
(
user
,
tm
,
apply
,
nclones
,
orderTm
,
JSON
.
stringify
(
productItem
),
t
);
return
system
.
getResultSuccess
({
deliveryOrderNo
:
orderProductObj
.
deliveryOrderNo
,
channelServiceNo
:
channelOrder
.
channelServiceNo
,
channelParams
:
params
.
channelParams
,
tm
:
returnTm
});
})
}
/**
* 接收辅助注册商标修改数据
*/
async
editAssistTm
(
obj
){
return
system
.
getResultSuccess
(
null
,
"接口开发中"
);
}
//------------------------接收辅助注册商标数据--------end---------------------------------------------------------
}
...
...
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