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
e2b5557a
Commit
e2b5557a
authored
Dec 13, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
0a51d1db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
66 deletions
+90
-66
igirl-channel/app/base/service/impl/dborder/ordertmproductSve.js
+90
-66
No files found.
igirl-channel/app/base/service/impl/dborder/ordertmproductSve.js
View file @
e2b5557a
...
...
@@ -62,24 +62,28 @@ class OrderTmProductService extends ServiceBase {
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
tbcode
=
await
self
.
getBusUid
(
"tb"
);
var
nclone
=
nclones
[
i
];
var
nclthreeobj
=
nclone
.
nclThree
;
if
(
nclone
)
{
tm
.
nclOneCodes
.
push
(
nclone
.
code
);
tm
.
nclCount
=
tm
.
nclCount
+
nclthreeobj
.
length
;
}
}
}
var
verifyResult
=
await
self
.
isOrderVerify
(
user
,
1
,
tm
,
productItem
,
nclones
,
null
);
if
(
verifyResult
)
{
return
verifyResult
;
}
// 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 tbcode = await self.getBusUid("tb");
// 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"
]
=
"图形"
;
}
...
...
@@ -182,24 +186,29 @@ class OrderTmProductService extends ServiceBase {
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
tbcode
=
await
self
.
getBusUid
(
"tb"
);
var
nclone
=
nclones
[
i
];
var
nclthreeobj
=
nclone
.
nclThree
;
if
(
nclone
)
{
tm
.
nclOneCodes
.
push
(
nclone
.
code
);
tm
.
nclCount
=
tm
.
nclCount
+
nclthreeobj
.
length
;
}
}
var
verifyResult
=
await
self
.
isOrderVerify
(
user
,
1
,
tm
,
productItem
,
nclones
,
null
);
if
(
verifyResult
)
{
return
verifyResult
;
}
// 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 tbcode = await self.getBusUid("tb");
// 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"
]
=
"图形"
;
}
...
...
@@ -207,8 +216,8 @@ class OrderTmProductService extends ServiceBase {
//创建订单
var
ordercode
=
await
self
.
getBusUid
(
"tm"
);
var
orderAmount
=
tm
;
orderAmount
.
salesNum
=
tm
.
nclOneCodes
.
length
;
orderAmount
.
minitermNum
=
tm
.
nclCount
;
orderAmount
.
salesNum
=
tm
.
nclOneCodes
?
tm
.
nclOneCodes
.
length
:
0
;
orderAmount
.
minitermNum
=
tm
.
nclCount
?
tm
.
nclCount
:
0
;
channelOrder
.
payStatus
=
"dfk"
;
var
orderResult
=
await
self
.
orderDao
.
addOrder
(
ordercode
,
orderType
,
user
,
app
,
productItem
,
channelOrder
,
channelUser
,
apply
,
orderAmount
,
t
);
if
(
orderResult
.
status
!=
0
)
{
...
...
@@ -294,7 +303,6 @@ class OrderTmProductService extends ServiceBase {
/*
verifyType==1为商标注册验证,2为其他订单验证
*/
tm
.
nclOneCodes
=
[];
var
sveItemRateConfig
=
serviceitem
.
rateConfig
?
Number
(
serviceitem
.
rateConfig
)
:
0
;
//产品费率
var
fwf
=
serviceitem
.
serviceCharge
?
Number
(
serviceitem
.
serviceCharge
)
:
0
;
//服务费
var
yhfl
=
serviceitem
.
discountsRateConfig
?
Number
(
serviceitem
.
discountsRateConfig
)
:
0
;
//最大优惠费率
...
...
@@ -302,7 +310,7 @@ class OrderTmProductService extends ServiceBase {
var
nclSmallPrice
=
gf
/
10
;
//单个小类官费
nclSmallPrice
=
Number
(
nclSmallPrice
.
toFixed
(
2
));
var
productCount
=
1
;
//产品数量
var
gfze
=
0
;
//官费总额
var
gfze
=
0
;
//官费总额
--------------------------------------------------------------------------------------------
if
(
verifyType
==
1
)
{
tm
.
nclOneCodes
=
[];
tm
.
nclCount
=
0
;
...
...
@@ -310,7 +318,7 @@ class OrderTmProductService extends ServiceBase {
for
(
var
a
=
0
;
a
<
nclones
.
length
;
a
++
)
{
var
nclone
=
nclones
[
a
];
tm
.
nclOneCodes
.
push
(
nclone
.
code
);
tm
.
nclCount
=
tm
.
nclCount
+
ncl
threeobj
.
length
;
tm
.
nclCount
=
tm
.
nclCount
+
ncl
one
.
nclThree
.
length
;
var
nclthreeobj
=
nclone
.
nclThree
;
gfze
=
gfze
+
gf
;
if
(
nclthreeobj
.
length
>
10
)
{
...
...
@@ -322,39 +330,55 @@ class OrderTmProductService extends ServiceBase {
productCount
=
buyProductCount
;
gfze
=
gf
*
Number
(
productCount
);
}
var
fwfze
=
Number
(
fwf
)
*
Number
(
productCount
);
//服务费总额
var
fwfze
=
Number
(
fwf
)
*
Number
(
productCount
);
//服务费总额
--------------------------------------------------------------------------------------------
var
sfze
=
Number
(
tm
.
totalSum
)
/
(
sveItemRateConfig
+
100
)
*
sveItemRateConfig
;
//totalTaxes 税费总额
sfze
=
sfze
.
toFixed
(
2
);
sfze
=
Number
(
sfze
);
var
zdyhe
=
(
gfze
+
fwfze
)
*
yhfl
/
100
;
//最大优惠额
sfze
=
Number
(
sfze
);
//--------------------------------------------------------------------------------------------
var
zdyhe
=
(
gfze
+
fwfze
)
*
yhfl
/
100
;
//最大优惠额
-------------------------------------------------------------------------------------------
zdyhe
=
zdyhe
.
toFixed
(
2
);
zdyhe
=
Number
(
zdyhe
);
//毛利总额=应付总额-官费总额
var
mlze
=
Number
(
tm
.
totalSum
)
-
gfze
;
//totalProfitSum 毛利总额
var
mlze
=
Number
(
tm
.
totalSum
)
-
gfze
;
//totalProfitSum 毛利总额
--------------------------------------------------------------------------------------------
mlze
=
mlze
.
toFixed
(
2
);
mlze
=
Number
(
mlze
);
//优惠金额=服务费+官费总额-应付总额(服务费、官费之和小于等于应付总额时,优惠金额为零)
var
yhje
=
fwfze
+
gfze
-
Number
(
tm
.
totalSum
);
if
(
yhje
<
0
)
{
yhje
=
0
;
}
yhje
=
yhje
.
toFixed
(
2
);
yhje
=
Number
(
yhje
);
if
(
fwfze
!=
Number
(
tm
.
totalServiceCharge
))
{
return
{
code
:
-
201
,
msg
:
"服务费总额有误"
};
}
if
(
gfze
!=
Number
(
tm
.
totalPublicExpense
))
{
return
{
code
:
-
202
,
msg
:
"官费总额有误"
};
}
if
(
sfze
!=
Number
(
tm
.
totalTaxes
))
{
return
{
code
:
-
203
,
msg
:
"税费总额有误"
};
}
if
(
mlze
!=
Number
(
tm
.
totalProfitSum
))
{
return
{
code
:
-
204
,
msg
:
"毛利总额有误"
};
}
if
(
yhje
!=
Number
(
tm
.
totalDiscounts
)
||
yhje
>
zdyhe
)
{
return
{
code
:
-
205
,
msg
:
"优惠总额有误"
};
var
ddze
=
Number
(
fwfze
)
+
Number
(
gfze
);
//订单总额---------------------------------------------------
if
(
Number
(
tm
.
totalSum
)
<
Number
(
ddze
))
{
return
{
code
:
-
201
,
msg
:
"订单总额有误"
};
}
tm
.
totalServiceCharge
=
fwfze
;
// 服务费总额(产品配置的服务费*订单件数)
tm
.
totalPublicExpense
=
gfze
;
// 官费总额(产品配置的官费*订单件数)
tm
.
totalDiscounts
=
zdyhe
;
// 优惠总额((服务费总额+官费总额)-订单总额(产品价格×优惠费率×订单件数)>0则有优惠额度)
tm
.
totalTaxes
=
sfze
;
// 税费总额(订单总额-(订单总额/(1+产品费率)))
return
""
;
// //优惠金额=服务费+官费总额-应付总额(服务费、官费之和小于等于应付总额时,优惠金额为零)
// var yhje = fwfze + gfze - Number(tm.totalSum);
// if (yhje < 0) {
// yhje = 0;
// }
// yhje = yhje.toFixed(2);
// yhje = Number(yhje);
// if (fwfze != Number(tm.totalServiceCharge)) {
// return { code: -201, msg: "服务费总额有误" };
// }
// if (gfze != Number(tm.totalPublicExpense)) {
// return { code: -202, msg: "官费总额有误" };
// }
// if (sfze != Number(tm.totalTaxes)) {
// return { code: -203, msg: "税费总额有误" };
// }
// if (mlze != Number(tm.totalProfitSum)) {
// return { code: -204, msg: "毛利总额有误" };
// }
// if (yhje != Number(tm.totalDiscounts) || yhje > zdyhe) {
// return { code: -205, msg: "优惠总额有误" };
// }
// var channelProfitSum = 0;//订单渠道分成毛利润总额
// var pfProfitSum = 0;//订单平台毛利润总额
// var totalProfitSum = Number(tm.totalProfitSum);//订单毛利润总额
...
...
@@ -375,7 +399,7 @@ class OrderTmProductService extends ServiceBase {
// pfProfitSum = mlze;//毛利总额
// }
// }//渠道利润分成比率(只分订单中毛利润总额的分成)
return
""
;
//
return "";
}
async
opCustomerInfo
(
user
,
apply
,
orderObj
,
t
)
{
//订单客户档案添加和修改
var
customerInfoObj
=
{
...
...
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