Commit 77a8c04b by 宋毅

tj

parent 9b3675df
...@@ -18,9 +18,17 @@ class OrderInfoService extends ServiceBase { ...@@ -18,9 +18,17 @@ class OrderInfoService extends ServiceBase {
var channelOrder = actionBody.channelOrder; var channelOrder = actionBody.channelOrder;
var orderContact = actionBody.orderContact; var orderContact = actionBody.orderContact;
var price_item = actionBody.product_info.price_item; var price_item = actionBody.product_info.price_item;
var totalServiceCharge = Number(price_item.service_charge || 0) * Number(actionBody.quantity); var totalServiceCharge = Number(price_item.service_charge || 0) * Number(actionBody.quantity || 0);
var totalPublicExpense = Number(price_item.public_expense || 0) * Number(actionBody.quantity); var totalPublicExpense = Number(price_item.public_expense || 0) * Number(actionBody.quantity || 0);
var totalProfitSum = Number(actionBody.totalSum) - (Number(price_item.supply_price || 0) * Number(actionBody.quantity)); var totalSupplyPrice = Number(price_item.supply_price || 0) * Number(actionBody.quantity || 0);//统计供货价格
var price_additions_item = actionBody.product_info.price_additions_item;
if (price_additions_item && actionBody.additions.quantity) {
totalServiceCharge = totalServiceCharge + Number(price_additions_item.service_charge || 0) * Number(actionBody.additions.quantity || 0);
totalPublicExpense = totalPublicExpense + Number(price_additions_item.public_expense || 0) * Number(actionBody.additions.quantity || 0);
totalSupplyPrice = totalSupplyPrice + Number(price_additions_item.supply_price || 0) * Number(actionBody.additions.quantity || 0);//统计供货价格
}
var totalProfitSum = Number(actionBody.totalSum) - Number(totalSupplyPrice || 0);//利润
var pfProfitSum = (100 - Number(price_item.channel_profit_rate || 0)) / 100 * totalProfitSum; var pfProfitSum = (100 - Number(price_item.channel_profit_rate || 0)) / 100 * totalProfitSum;
if (pfProfitSum < 0) { if (pfProfitSum < 0) {
pfProfitSum = 0; pfProfitSum = 0;
...@@ -62,6 +70,9 @@ class OrderInfoService extends ServiceBase { ...@@ -62,6 +70,9 @@ class OrderInfoService extends ServiceBase {
isShow: 1 isShow: 1
}; };
await this.flowlogDao.create(orderLog, t); await this.flowlogDao.create(orderLog, t);
if (["zzsbzc"].indexOf(actionBody.product_info.item_code) < 0) {
delete actionBody.product_info["price_list"];
}
var orderProductObj = { var orderProductObj = {
uapp_id: pobj.appInfo.uapp_id, uapp_id: pobj.appInfo.uapp_id,
sourceOrderNo: orderNo, // 来源单号 sourceOrderNo: orderNo, // 来源单号
...@@ -164,48 +175,49 @@ class OrderInfoService extends ServiceBase { ...@@ -164,48 +175,49 @@ class OrderInfoService extends ServiceBase {
async packagingTmDeliveryData(pobj, actionBody) {//重新组装商标交付信息 async packagingTmDeliveryData(pobj, actionBody) {//重新组装商标交付信息
if (!actionBody.deliveryData || Object.keys(actionBody.deliveryData).length == 0) { if (!actionBody.deliveryData || Object.keys(actionBody.deliveryData).length == 0) {
return "交付数据不能为空,20135"; return system.getResult(null, "交付数据不能为空,20135");
} }
if (Number(actionBody.totalSum) < 300) { if (Number(actionBody.totalSum) < 300) {
return "总价有误,总价不能小于300,20140"; return system.getResult(null, "总价有误,总价不能小于300,20140");
} }
var deliveryData = actionBody.deliveryData; var deliveryData = actionBody.deliveryData;
if (!deliveryData.nclones) { if (!deliveryData.nclones) {
return "商品/服务项不能为空,20150"; return system.getResult(null, "商品/服务项不能为空,20150");
} }
if (!deliveryData.tm) { if (!deliveryData.tm) {
return "商标信息不能为空,20180"; return system.getResult(null, "商标信息不能为空,20180");
} }
if (!deliveryData.tm.tmFormType) { if (!deliveryData.tm.tmFormType) {
return "商标类型不能为空,20183"; return system.getResult(null, "商标类型不能为空,20183");
} }
if (["3", "4", "5"].indexOf(deliveryData.tm.tmFormType) < 0) { if (["3", "4", "5"].indexOf(deliveryData.tm.tmFormType) < 0) {
return "商标类型值错误,20185"; return system.getResult(null, "商标类型值错误,20185");
} }
if (deliveryData.tm.tmFormType == "4") { if (deliveryData.tm.tmFormType == "4") {
pobj.actionBody.deliveryData.tm.tmName = "图形"; pobj.actionBody.deliveryData.tm.tmName = "图形";
deliveryData.tm.tmName = "图形"; deliveryData.tm.tmName = "图形";
pobj.actionBody.channelItemAppendName = "图形";
} }
if (!deliveryData.tm.tmName) { if (!deliveryData.tm.tmName) {
return "商标名称不能为空,20180"; return system.getResult(null, "商标名称不能为空,20180");
} }
if (!deliveryData.tm.picUrl) { if (!deliveryData.tm.picUrl) {
return "商标图样不能为空,20210"; return system.getResult(null, "商标图样不能为空,20210");
} }
if (!deliveryData.apply) { if (!deliveryData.apply) {
return "申请信息不能为空,20230"; return system.getResult(null, "申请信息不能为空,20230");
} }
if (!deliveryData.apply.code) { if (!deliveryData.apply.code) {
return "申请统一社会信用代码不能为空,20250"; return system.getResult(null, "申请统一社会信用代码不能为空,20250");
} }
if (!deliveryData.apply.zipCode) { if (!deliveryData.apply.zipCode) {
return "申请邮编不能为空,20280"; return system.getResult(null, "申请邮编不能为空,20280");
} }
if (!deliveryData.apply.customerType) { if (!deliveryData.apply.customerType) {
return "申请人类型不能为空,20310"; return system.getResult(null, "申请人类型不能为空,20310");
} }
if (deliveryData.apply.customerType != "ent" && deliveryData.apply.customerType != "person") { if (deliveryData.apply.customerType != "ent" && deliveryData.apply.customerType != "person") {
return "申请人类型错误,20330"; return system.getResult(null, "申请人类型错误,20330");
} }
var deliveryStatus = "dsccl"; var deliveryStatus = "dsccl";
var deliveryStatusName = "待上传材料"; var deliveryStatusName = "待上传材料";
...@@ -235,20 +247,35 @@ class OrderInfoService extends ServiceBase { ...@@ -235,20 +247,35 @@ class OrderInfoService extends ServiceBase {
}); });
} }
} }
actionBody.quantity = deliveryData.nclones.length;
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;//计算多余的尼斯数量
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 = nclThree.length < 10 ? (Number(price_item.price) * 10) : (Number(price_item.price) * nclThree.length); deliveryData.nclones[index].nclPublicExpense = 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 - 10);
}
if (extraNclCount > 0) {
if (!actionBody.additions) {
return system.getResult(null, "附加购买项目不能为空,20335");
}
if (!actionBody.product_info.price_additions_item) {
return system.getResult(null, "没有查询到附加购买项目信息,20336");
}
//重新计算尼斯官费
for (let g = 0; g < deliveryData.nclones.length; g++) {
const nclThree = deliveryData.nclones[g].nclThree;
deliveryData.nclones[g].nclPublicExpense = Number(deliveryData.nclones[g].nclPublicExpense) + (nclThree.length - 10) * Number(actionBody.product_info.price_additions_item.public_expense);
}
} }
pobj.actionBody.deliveryData.deliveryStatus = deliveryStatus; pobj.actionBody.deliveryData.deliveryStatus = deliveryStatus;
pobj.actionBody.deliveryData.deliveryStatusName = deliveryStatusName; pobj.actionBody.deliveryData.deliveryStatusName = deliveryStatusName;
pobj.actionBody.deliveryData.deliveryStatusList = deliveryStatusList; pobj.actionBody.deliveryData.deliveryStatusList = deliveryStatusList;
...@@ -495,7 +522,11 @@ class OrderInfoService extends ServiceBase { ...@@ -495,7 +522,11 @@ class OrderInfoService extends ServiceBase {
if (actionBody.notes) { if (actionBody.notes) {
actionBody.isGetContact = 0; actionBody.isGetContact = 0;
var itemResult = await this.getOrderDeliveryInfo(pobj, actionBody); var itemResult = await this.getOrderDeliveryInfo(pobj, actionBody);
if (itemResult.status == 0) { if (itemResult.status == 0) { //重新计算尼斯官费
for (let g = 0; g < tempNclList.length; g++) {
const nclThree = tempNclList[g].nclThree;
tempNclList[g].nclPublicExpense = Number(tempNclList[g].nclPublicExpense) + (nclThree.length - 10) * Number(price_additions_item.public_expense);
}
if (actionBody.notes != itemResult.data.notes) { if (actionBody.notes != itemResult.data.notes) {
itemResult.data.notes = actionBody.notes; itemResult.data.notes = actionBody.notes;
this.putOrderDelivery(itemResult.data, actionBody.orderNo); this.putOrderDelivery(itemResult.data, actionBody.orderNo);
...@@ -607,20 +638,12 @@ class OrderInfoService extends ServiceBase { ...@@ -607,20 +638,12 @@ class OrderInfoService extends ServiceBase {
} }
var tempNclList = actionBody.nclones; var tempNclList = actionBody.nclones;
if (tempNclList && tempNclList.length > 0) { if (tempNclList && tempNclList.length > 0) {
var dbNclList = itemResult.data.nclones;
if (dbNclList.length < tempNclList.length) {
return system.getResult(null, "修改失败,尼斯大类应该为:" + dbNclList.length + "个大类,当前选择了" + tempNclList.length + "个大类,30040");
}
var dbNclThreeCount = 0;
for (let k = 0; k < dbNclList.length; k++) {
const kItem = dbNclList[k];
dbNclThreeCount = dbNclThreeCount + Number(kItem.nclCount);
}
var nclThreeCount = 0; var nclThreeCount = 0;
var extraNclCount = 0;//计算多余的尼斯数量
for (let h = 0; h < tempNclList.length; h++) { for (let h = 0; h < tempNclList.length; h++) {
const nclThree = tempNclList[h].nclThree; const nclThree = tempNclList[h].nclThree;
tempNclList[h].nclCount = nclThree.length; tempNclList[h].nclCount = nclThree.length;
tempNclList[h].nclPublicExpense = nclThree.length < 10 ? (Number(product_info.price_item.price) * 10) : (Number(product_info.price_item.price) * nclThree.length); tempNclList[h].nclPublicExpense = Number(product_info.price_item.public_expense);
tempNclList[h].tmStatus = itemResult.data.deliveryStatus || "";//商标交付状态 tempNclList[h].tmStatus = itemResult.data.deliveryStatus || "";//商标交付状态
tempNclList[h].tmStatusName = itemResult.data.deliveryStatusName || ""; tempNclList[h].tmStatusName = itemResult.data.deliveryStatusName || "";
tempNclList[h].submitTime = ""; tempNclList[h].submitTime = "";
...@@ -629,18 +652,95 @@ class OrderInfoService extends ServiceBase { ...@@ -629,18 +652,95 @@ class OrderInfoService extends ServiceBase {
tempNclList[h].tmRegistNum = ""; tempNclList[h].tmRegistNum = "";
tempNclList[h].nclThree = nclThree; tempNclList[h].nclThree = nclThree;
nclThreeCount = nclThreeCount + nclThree.length; nclThreeCount = nclThreeCount + nclThree.length;
extraNclCount = extraNclCount + (nclThree.length - 10);
} }
if (dbNclThreeCount < nclThreeCount) { if (extraNclCount > 0) {
var tempDbNclThreeCount = dbNclList.length * 10; if (!actionBody.additions) {
if (tempDbNclThreeCount < nclThreeCount) { return system.getResult(null, "附加购买项目不能为空,20338");
return system.getResult(null, "修改失败,尼斯应该为:" + dbNclThreeCount + "个小项,当前选择了" + nclThreeCount + "个小项,30050");
} }
} }
if (orderItem.orderStatus == 2) {
var dbNclList = itemResult.data.nclones;
if (dbNclList.length < tempNclList.length) {
return system.getResult(null, "修改失败,尼斯大类应该为:" + dbNclList.length + "个大类,当前选择了" + tempNclList.length + "个大类,30040");
}
var dbNclThreeCount = 0;
for (let k = 0; k < dbNclList.length; k++) {
const kItem = dbNclList[k];
dbNclThreeCount = dbNclThreeCount + Number(kItem.nclCount);
}
if (dbNclThreeCount < nclThreeCount) {
var tempDbNclThreeCount = dbNclList.length * 10;
if (tempDbNclThreeCount < nclThreeCount) {
return system.getResult(null, "修改失败,尼斯应该为:" + dbNclThreeCount + "个小项,当前选择了" + nclThreeCount + "个小项,30050");
}
}
}//已付款进行修改尼斯数据
if (orderItem.orderStatus == 1) {
actionBody.quantity = tempNclList.length;
var isUpdateProduct = 0;
var price_item = product_info.price_item;
var price_additions_item = product_info.price_additions_item;
var totalSum = Number(price_item.price) * Number(actionBody.quantity);
var totalServiceCharge = Number(price_item.service_charge || 0) * Number(actionBody.quantity || 0);
var totalPublicExpense = Number(price_item.public_expense || 0) * Number(actionBody.quantity || 0);
var totalSupplyPrice = Number(price_item.supply_price || 0) * Number(actionBody.quantity || 0);//统计供货价格
if (extraNclCount > 0) {
if (!price_additions_item) {
var additionsIndex = product_info.price_list.findIndex(f => f.pay_code == actionBody.additions.payCode && f.is_show == 0);
if (additionsIndex >= 0) {
isUpdateProduct++;
price_additions_item = product_info.price_list[additionsIndex];
product_info.price_additions_item = price_additions_item;
}
}
totalSum = totalSum + Number(price_additions_item.price) * extraNclCount;
totalServiceCharge = totalServiceCharge + Number(price_additions_item.service_charge || 0) * extraNclCount;
totalPublicExpense = totalPublicExpense + Number(price_additions_item.public_expense || 0) * extraNclCount;
totalSupplyPrice = totalSupplyPrice + Number(price_additions_item.supply_price || 0) * extraNclCount;//统计供货价格
//重新计算尼斯官费
for (let g = 0; g < tempNclList.length; g++) {
const nclThree = tempNclList[g].nclThree;
tempNclList[g].nclPublicExpense = Number(tempNclList[g].nclPublicExpense) + (nclThree.length - 10) * Number(price_additions_item.public_expense);
}
}
else {
if (price_additions_item) {
isUpdateProduct++;
delete product_info["price_additions_item"];
}
}
var totalProfitSum = Number(totalSum) - Number(totalSupplyPrice || 0);//利润
var pfProfitSum = (100 - Number(price_item.channel_profit_rate || 0)) / 100 * totalProfitSum;
if (pfProfitSum < 0) {
pfProfitSum = 0;
}
var channelProfitSum = Number(totalProfitSum) - Number(pfProfitSum);
await self.db.transaction(async function (t) {
if (Number(orderItem.totalSum) != totalSum) {
var putOrderFields = {
totalSum: totalSum,//decimal(12,2) //订单总额(产品价格×优惠费率×订单件数)
payTotalSum: totalSum,//decimal(12,2) //
refundSum: 0,//decimal(12,2) //退款总额
totalServiceCharge: totalServiceCharge,//decimal(12,2) //服务费总额(产品配置的服务费*订单件数)
totalPublicExpense: totalPublicExpense,//decimal(12,2) //官费总额(产品配置的官费*订单件数)
totalProfitSum: totalProfitSum,//decimal(12,2) //订单毛利润总额(产品价格-供货价格))
pfProfitSum: pfProfitSum,//decimal(12,2) //订单平台毛利润总额((100-渠道利润分成比例)/100 * 订单毛利润总额)
channelProfitSum: channelProfitSum//decimal(12,2) //订单渠道分成毛利润总额(订单毛利润总额-平台毛利润总额)
}
self.updateByWhere(putOrderFields, { where: { orderNo: actionBody.orderNo } }, t);
self.orderReceiptVoucherDao.updateByWhere({ totalSum: totalSum }, { where: { sourceOrderNo: actionBody.orderNo } }, t);
}
if (isUpdateProduct > 0) {
self.orderproductDao.updateByWhere({ serviceItemSnapshot: JSON.stringify(product_info) }, { where: { sourceOrderNo: actionBody.orderNo } }, t);
}
});
}//未付款进行订单金额修改
itemResult.data.nclones = tempNclList; itemResult.data.nclones = tempNclList;
actionBody.nclones = tempNclList; actionBody.nclones = tempNclList;
} }
this.putOrderDelivery(itemResult.data, actionBody.orderNo); this.putOrderDelivery(itemResult.data, actionBody.orderNo);
delete actionBody["isGetContact"]; delete actionBody["isGetContact"];
actionBody.orderStatus = orderItem.orderStatus; actionBody.orderStatus = orderItem.orderStatus;
if (orderItem.orderStatus < 4) { if (orderItem.orderStatus < 4) {
...@@ -813,7 +913,6 @@ class OrderInfoService extends ServiceBase { ...@@ -813,7 +913,6 @@ class OrderInfoService extends ServiceBase {
//**************************************/获取订单信息**********end************************************** //**************************************/获取订单信息**********end**************************************
//-------------------------------服务商通知订单流程-------------start---------------- //-------------------------------服务商通知订单流程-------------start----------------
async icOrderStatusNotify(pobj, actionBody) {//峰擎通知工商办理状态 async icOrderStatusNotify(pobj, actionBody) {//峰擎通知工商办理状态
var item = await this.dao.getItemStatusByOrderNo(actionBody.orderNo); var item = await this.dao.getItemStatusByOrderNo(actionBody.orderNo);
if (!item) { if (!item) {
...@@ -849,7 +948,7 @@ class OrderInfoService extends ServiceBase { ...@@ -849,7 +948,7 @@ class OrderInfoService extends ServiceBase {
updateDeliveryInfo.updated = actionBody.updated; updateDeliveryInfo.updated = actionBody.updated;
updateDeliveryInfo.orderDeliveryStatus = actionBody.orderDeliveryStatus; updateDeliveryInfo.orderDeliveryStatus = actionBody.orderDeliveryStatus;
var tempList = actionBody.orderDeliveryStatusName.split('-'); var tempList = actionBody.orderDeliveryStatusName.split('-');
updateDeliveryInfo.orderDeliveryStatusName = tempList[tempList.l修改ength - 1]; updateDeliveryInfo.orderDeliveryStatusName = tempList[tempList.length - 1];
var dataIndex = updateDeliveryInfo.flowList.findIndex(f => f.orderDeliveryStatus == actionBody.orderDeliveryStatus); var dataIndex = updateDeliveryInfo.flowList.findIndex(f => f.orderDeliveryStatus == actionBody.orderDeliveryStatus);
if (dataIndex > -1) { if (dataIndex > -1) {
...@@ -886,29 +985,126 @@ class OrderInfoService extends ServiceBase { ...@@ -886,29 +985,126 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
async updateTmStatus(pobj) { async updateTmStatus(actionBody) {
if (!pobj.tbCode) { if (!actionBody.tbCode) {
return system.getResult(null, "处理失败,tbCode不能为空,30160"); return system.getResult(null, "处理失败,tbCode不能为空,30160");
} }
if (!pobj.tmStatus) { if (!actionBody.tmStatus) {
return system.getResult(null, "处理失败,tmStatus不能为空,30163"); return system.getResult(null, "处理失败,tmStatus不能为空,30163");
} }
if (!pobj.tmStatusName) { if (!actionBody.tmStatusName) {
return system.getResult(null, "处理失败,tmStatusName不能为空,30165"); return system.getResult(null, "处理失败,tmStatusName不能为空,30165");
} }
var orderItem = await this.dao.getItemStatusByOrderNo(actionBody.orderNo);
// if (pobj.submitTime) { if (!orderItem) {
return system.getResult(null, "修改失败,修改的数据为空,30170");
// }//修改提报时间 }
// if (pobj.registNumInfo && pobj.registNumInfo.tmRegistNum) { if (orderItem.orderStatus == 1) {
return system.getResult(null, "修改失败,修改的订单数据未未付款数据为空,30175");
}
actionBody.orderContact = 1;
var deliveryInfo = await this.getOrderDeliveryFlowInfo(null, actionBody);
if (!deliveryInfo) {
return system.getResult(null, "修改失败,订单对应的产品数据为空,30180");
}
var tbCodeIndex = deliveryInfo.nclones.findIndex(f => f.tbCode == actionBody.tbCode);
if (tbCodeIndex < 0) {
return system.getResult(null, "修改失败,订单对应的提报数据为空,30185");
}
deliveryInfo.nclones[tbCodeIndex].tmStatus = actionBody.tmStatus;
deliveryInfo.nclones[tbCodeIndex].tmStatusName = actionBody.tmStatusName;
var updateOrderFields = null;
var orderLog = {
uapp_id: orderItem.uapp_id,
sourceOrderNo: actionBody.orderNo,
created_at: new Date(),
opContent: "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【" + actionBody.tmStatusName + "】",
isShow: 1
};
var oldDeliveryStatus = deliveryInfo.deliveryStatus;
if (actionBody.tmStatus == "WAITCOMMIT") {
updateOrderFields.orderStatus = 4;
deliveryInfo.deliveryStatus = "ddj";
deliveryInfo.deliveryStatusName = "待递交";
deliveryInfo.nclones[tbCodeIndex].tmStatusName = "待递交";
orderLog.opContent = "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【待递交】";
}//待提交
else if (actionBody.tmStatus == "RECVCOMMIT") {
updateOrderFields.orderStatus = 8;
deliveryInfo.deliveryStatus = "ydj";
deliveryInfo.deliveryStatusName = "已递交";
deliveryInfo.nclones[tbCodeIndex].tmStatusName = "已递交";
orderLog.opContent = "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【已递交】";
}//已收提交
// }//更新商标申请号 if (deliveryInfo.deliveryStatus != oldDeliveryStatus) {
var deliveryStatusList = deliveryInfo.deliveryStatusList;
if (deliveryStatusList && deliveryStatusList.length > 0) {
var deliveryStatusIndex = deliveryStatusList.findIndex(f => f.deliveryStatus == deliveryInfo.deliveryStatus);
if (deliveryStatusIndex < 0) {
deliveryStatusList.push({
deliveryStatus: deliveryInfo.deliveryStatus,
deliveryStatusName: deliveryInfo.deliveryStatusName,
deliveryUpdated: new Date()
});
deliveryInfo.deliveryStatusList = deliveryStatusList;
}
}
}//增加流程状态列表数据
if (actionBody.submitTime) {
deliveryInfo.nclones[tbCodeIndex].submitTime = actionBody.submitTime;
}//修改提报时间
if (actionBody.registNumInfo && actionBody.registNumInfo.tmRegistNum) {
deliveryInfo.nclones[tbCodeIndex].tmRegistNum = actionBody.registNumInfo.tmRegistNum;
}//更新商标申请号
if (actionBody.officialInfo) {
this.updateTmOfficialInfo(actionBody);
}//更新商标官文
this.putOrderDelivery(deliveryInfo, actionBody.orderNo);
} }
async updateTmOfficialInfo(actionBody) {//更新商标官文信息
var flowList = [];
actionBody.sourceOrderNo = actionBody.orderNo;
var deliveryFlowInfo = await this.getOrderDeliveryFlowInfo(actionBody);
var addi = 0;
if (!deliveryFlowInfo.data) {
flowList.push({
updated: actionBody.officialInfo.updated,
uploadFileName: actionBody.officialInfo.uploadFileName,
returnReceiptUrl: actionBody.officialInfo.returnReceiptUrl,
tmStatus: actionBody.tmStatus,
tmStatusName: actionBody.tmStatusName
});
addi++;
}
else {
flowList = deliveryFlowInfo.data;
}
var dataIndex = flowList.findIndex(f => f.tmStatus == actionBody.tmStatus);
if (dataIndex < 0) {
flowList.push({
updated: actionBody.officialInfo.updated,
uploadFileName: actionBody.officialInfo.uploadFileName,
returnReceiptUrl: actionBody.officialInfo.returnReceiptUrl,
tmStatus: actionBody.tmStatus,
tmStatusName: actionBody.tmStatusName
});
}
var sql = null;
if (addi > 0) {
await this.dao.updateByWhere({ orderStatus: 4 }, { where: { id: item.id } });
sql = "INSERT INTO `c_delivery_official_flow` (`sourceOrderNo`,`officialFlow`) VALUE('" +
actionBody.orderNo + "','" + JSON.stringify(flowList) + "')";
}
else {
sql = "UPDATE `c_delivery_official_flow` SET officialFlow ='" + JSON.stringify(flowList) + "' where sourceOrderNo='" + actionBody.orderNo + "'";
}
this.customQuery(sql);
return system.getResultSuccess();
}
async opOrderPayCallBackTl(parmas, appInfo) {//操作订单付款回调---通联 async opOrderPayCallBackTl(parmas, appInfo) {//操作订单付款回调---通联
var item = await this.dao.getItemStatusByOrderNo(parmas.orderNo) var item = await this.dao.getItemStatusByOrderNo(parmas.orderNo)
......
已经使用的编码汇总: 已经使用的编码汇总:
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
30130 30130
30140 30140
30150 30150
30160
30170
30180
30190
======================================================== ========================================================
......
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