Commit a9a21164 by 宋毅

tj

parent f91114fe
......@@ -37,7 +37,7 @@ class ReceiveDataAPI extends APIBase {
case "1688"://1688
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break;
case "gsb"://gsb
case "gsbhome"://gsb_homepage
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break;
default:
......
......@@ -38,7 +38,7 @@ class TmOrderAPI extends APIBase {
case "1688"://1688
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break;
case "gsb"://1688
case "gsbhome"://gsb_homepage
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break;
default:
......@@ -109,7 +109,7 @@ class TmOrderAPI extends APIBase {
opResult = await this.ordertmproductSve.get1688ChannelOrder(action_body);
break;
case "subTmOrder"://商标提报
opResult = await this.ordertmproductSve.addTmOrder(action_body);
opResult = await this.ordertmproductSve.addTmOrder(action_body, pobj, req);
if (opResult && opResult.status == 0 && opResult.data) {
var returnTms = opResult.data.tm;
for (var i = 0; i < pobj.actionBody.nclones.length; i++) {
......
......@@ -29,7 +29,7 @@ class TmQueryAPI extends APIBase {
case "1688":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break;
case "gsb":
case "gsbhome":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break;
default:
......
......@@ -26,7 +26,7 @@ class TmToolsAPI extends APIBase {
case "1688":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break;
case "gsb":
case "gsbhome":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break;
default:
......
......@@ -164,7 +164,7 @@ class OrderTmProductService extends ServiceBase {
});
})
}
async addTmOrder(params) {//创建商标订单信息
async addTmOrder(params, pobj, req) {//创建商标订单信息
var self = this;
var itemCode = params.itemCode;//产品编码
var tm = params.tm;//增加sourceType || "00";//来源类型:00订单,10需求,20服务商
......@@ -193,15 +193,21 @@ class OrderTmProductService extends ServiceBase {
if (verifyResult) {
return verifyResult;
}
var orderAmount = tm;
orderAmount.salesNum = tm.nclOneCodes ? tm.nclOneCodes.length : 0;
orderAmount.minitermNum = tm.nclCount ? tm.nclCount : 0;
if (pobj.actionProcess == "jd") {
if (orderAmount.salesNum > 1 || orderAmount.minitermNum > 10) {
return system.getResult(null, "选择的尼斯数据有误,目前只支持1大类10小项");
}
}
if (tm.tmFormType == "4") {//图形商标
tm["name"] = "图形";
}
return await self.db.transaction(async function (t) {
//创建订单
var ordercode = await self.getBusUid("tm");
var orderAmount = tm;
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) {
......@@ -307,12 +313,14 @@ class OrderTmProductService extends ServiceBase {
productCount = nclones.length;
for (var a = 0; a < nclones.length; a++) {
var nclone = nclones[a];
tm.nclOneCodes.push(nclone.code);
tm.nclCount = tm.nclCount + nclone.nclThree.length;
var nclthreeobj = nclone.nclThree;
gfze = gfze + gf;
if (nclthreeobj.length > 10) {
gfze = gfze + (nclthreeobj.length - 10) * nclSmallPrice;
if (nclone.code) {
tm.nclOneCodes.push(nclone.code);
tm.nclCount = tm.nclCount + nclone.nclThree.length;
var nclthreeobj = nclone.nclThree;
gfze = gfze + gf;
if (nclthreeobj.length > 10) {
gfze = gfze + (nclthreeobj.length - 10) * nclSmallPrice;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment