Commit a9a21164 by 宋毅

tj

parent f91114fe
...@@ -37,7 +37,7 @@ class ReceiveDataAPI extends APIBase { ...@@ -37,7 +37,7 @@ class ReceiveDataAPI extends APIBase {
case "1688"://1688 case "1688"://1688
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break; break;
case "gsb"://gsb case "gsbhome"://gsb_homepage
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break; break;
default: default:
......
...@@ -38,7 +38,7 @@ class TmOrderAPI extends APIBase { ...@@ -38,7 +38,7 @@ class TmOrderAPI extends APIBase {
case "1688"://1688 case "1688"://1688
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break; break;
case "gsb"://1688 case "gsbhome"://gsb_homepage
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, pobj, req);
break; break;
default: default:
...@@ -109,7 +109,7 @@ class TmOrderAPI extends APIBase { ...@@ -109,7 +109,7 @@ class TmOrderAPI extends APIBase {
opResult = await this.ordertmproductSve.get1688ChannelOrder(action_body); opResult = await this.ordertmproductSve.get1688ChannelOrder(action_body);
break; break;
case "subTmOrder"://商标提报 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) { if (opResult && opResult.status == 0 && opResult.data) {
var returnTms = opResult.data.tm; var returnTms = opResult.data.tm;
for (var i = 0; i < pobj.actionBody.nclones.length; i++) { for (var i = 0; i < pobj.actionBody.nclones.length; i++) {
......
...@@ -29,7 +29,7 @@ class TmQueryAPI extends APIBase { ...@@ -29,7 +29,7 @@ class TmQueryAPI extends APIBase {
case "1688": case "1688":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break; break;
case "gsb": case "gsbhome":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break; break;
default: default:
......
...@@ -26,7 +26,7 @@ class TmToolsAPI extends APIBase { ...@@ -26,7 +26,7 @@ class TmToolsAPI extends APIBase {
case "1688": case "1688":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break; break;
case "gsb": case "gsbhome":
result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req); result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
break; break;
default: default:
......
...@@ -164,7 +164,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -164,7 +164,7 @@ class OrderTmProductService extends ServiceBase {
}); });
}) })
} }
async addTmOrder(params) {//创建商标订单信息 async addTmOrder(params, pobj, req) {//创建商标订单信息
var self = this; var self = this;
var itemCode = params.itemCode;//产品编码 var itemCode = params.itemCode;//产品编码
var tm = params.tm;//增加sourceType || "00";//来源类型:00订单,10需求,20服务商 var tm = params.tm;//增加sourceType || "00";//来源类型:00订单,10需求,20服务商
...@@ -193,15 +193,21 @@ class OrderTmProductService extends ServiceBase { ...@@ -193,15 +193,21 @@ class OrderTmProductService extends ServiceBase {
if (verifyResult) { if (verifyResult) {
return 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") {//图形商标 if (tm.tmFormType == "4") {//图形商标
tm["name"] = "图形"; tm["name"] = "图形";
} }
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
//创建订单 //创建订单
var ordercode = await self.getBusUid("tm"); 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"; channelOrder.payStatus = "dfk";
var orderResult = await self.orderDao.addOrder(ordercode, orderType, user, app, productItem, channelOrder, channelUser, apply, orderAmount, t); var orderResult = await self.orderDao.addOrder(ordercode, orderType, user, app, productItem, channelOrder, channelUser, apply, orderAmount, t);
if (orderResult.status != 0) { if (orderResult.status != 0) {
...@@ -307,12 +313,14 @@ class OrderTmProductService extends ServiceBase { ...@@ -307,12 +313,14 @@ class OrderTmProductService extends ServiceBase {
productCount = nclones.length; productCount = nclones.length;
for (var a = 0; a < nclones.length; a++) { for (var a = 0; a < nclones.length; a++) {
var nclone = nclones[a]; var nclone = nclones[a];
tm.nclOneCodes.push(nclone.code); if (nclone.code) {
tm.nclCount = tm.nclCount + nclone.nclThree.length; tm.nclOneCodes.push(nclone.code);
var nclthreeobj = nclone.nclThree; tm.nclCount = tm.nclCount + nclone.nclThree.length;
gfze = gfze + gf; var nclthreeobj = nclone.nclThree;
if (nclthreeobj.length > 10) { gfze = gfze + gf;
gfze = gfze + (nclthreeobj.length - 10) * nclSmallPrice; 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