Commit d021b43b by 庄冰

aaa

parents e3fd91be 2d6ac03d
...@@ -10,6 +10,7 @@ class OrderFlowDao extends Dao { ...@@ -10,6 +10,7 @@ class OrderFlowDao extends Dao {
sourceOrderNo: sourceOrderNo, sourceOrderNo: sourceOrderNo,
isShow: 1 isShow: 1
}, },
order:[["created_at", 'desc']],
raw: true raw: true
}); });
} }
......
...@@ -501,7 +501,7 @@ class OrderService extends ServiceBase { ...@@ -501,7 +501,7 @@ class OrderService extends ServiceBase {
userId: item.channelUserId,// 否 用户 ID userId: item.channelUserId,// 否 用户 ID
companyName: "",// 否 公司名称 companyName: "",// 否 公司名称
orderPrice: item.totalSum,// 是 订单金额 orderPrice: item.totalSum,// 是 订单金额
productId: "5dc936eb296d1572b9bc5b8d",// 是 产品 ID productId: "5dd513db4f3b08000a6fc082",// 是 产品 ID
productQuantity: item.salesNum,// 是 产品数量 productQuantity: item.salesNum,// 是 产品数量
}; };
rtn = await rc.post(reqUrl, body); rtn = await rc.post(reqUrl, body);
......
...@@ -34,6 +34,24 @@ class OrderTmProductService extends ServiceBase { ...@@ -34,6 +34,24 @@ class OrderTmProductService extends ServiceBase {
if (!nclones || nclones.length < 1) { if (!nclones || nclones.length < 1) {
return system.getResult(null, "尼斯大类不能为空"); return system.getResult(null, "尼斯大类不能为空");
} }
if (nclones.length > 1) {
return system.getResult(null, "尼斯大类不能大于1个大类");
}
//判断尼斯小项的数量
var selectNclThreeCount = 0;
for (let index = 0; index < nclones.length; index++) {
const element = nclones[index];
var nclList = null;
if (typeof (element) == "string") {
nclList = JSON.parse(element);
} else {
nclList = element;
}
selectNclThreeCount = selectNclThreeCount + nclList.nclThree.length;
}
if (selectNclThreeCount > 10) {
return system.getResult(null, "尼斯小项数量不能大于10个小项数量,目前选择的小项数量为" + selectNclThreeCount);
}
if (!itemCode) { if (!itemCode) {
return system.getResult(null, "itemCode参数错误"); return system.getResult(null, "itemCode参数错误");
} }
...@@ -103,7 +121,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -103,7 +121,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else { } else {
orderProductObj["deliveryStatus"] = "dsh"; orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待专家服务" : "订单已创建待付款";
} }
} }
if (apply.customerType == "ent") { if (apply.customerType == "ent") {
...@@ -112,7 +130,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -112,7 +130,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else { } else {
orderProductObj["deliveryStatus"] = "dsh"; orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待专家服务" : "订单已创建待付款";
} }
} }
//订单客户档案添加和修改 //订单客户档案添加和修改
...@@ -236,7 +254,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -236,7 +254,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else { } else {
orderProductObj["deliveryStatus"] = "dsh"; orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款" : "订单已创建待付款";
} }
} }
if (apply.customerType == "ent") { if (apply.customerType == "ent") {
...@@ -245,7 +263,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -245,7 +263,7 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else { } else {
orderProductObj["deliveryStatus"] = "dsh"; orderProductObj["deliveryStatus"] = "dsh";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款" : "订单已创建待付款";
} }
} }
//订单客户档案添加和修改 //订单客户档案添加和修改
...@@ -830,7 +848,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -830,7 +848,7 @@ class OrderTmProductService extends ServiceBase {
nclCount: tm.nclCount, nclCount: tm.nclCount,
}; };
var flowContent = ""; var flowContent = "";
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款"; flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待专家服务" : "订单已创建待付款";
// if (apply.customerType == "person") { // if (apply.customerType == "person") {
// if (!apply.businessLicensePic || !apply.identityCardPic || !tm.gzwtsUrl) { // if (!apply.businessLicensePic || !apply.identityCardPic || !tm.gzwtsUrl) {
// orderProductObj["deliveryStatus"] = "dsccl"; // orderProductObj["deliveryStatus"] = "dsccl";
......
const system = require("../../../system"); const system = require("../../../system");
const ServiceBase = require("../../sve.base"); const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
class TradeMarkService extends ServiceBase { class TradeMarkService extends ServiceBase {
constructor() { constructor() {
super("dbtrademark", ServiceBase.getDaoName(TradeMarkService)); super("dbtrademark", ServiceBase.getDaoName(TradeMarkService));
this.ordertmproductSve = system.getObject("service.dborder.ordertmproductSve"); this.ordertmproductSve = system.getObject("service.dborder.ordertmproductSve");
this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao"); this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao");
this.statusConvertJSON={ this.orderflowDao = system.getObject("db.dborder.orderflowDao");
this.statusConvertJSON = {
"WAITARTIFICIALEXAMINE": "dsh", "WAITARTIFICIALEXAMINE": "dsh",
"1": "1", "1": "1",
"2": "2", "2": "2",
...@@ -32,8 +33,8 @@ class TradeMarkService extends ServiceBase { ...@@ -32,8 +33,8 @@ class TradeMarkService extends ServiceBase {
"RECVCOMMIT": "ydj", "RECVCOMMIT": "ydj",
"FILLEXCEPTION": "shbtg", "FILLEXCEPTION": "shbtg",
//1688 //1688
"WAITCONFIRM":"dqrfa", "WAITCONFIRM": "dqrfa",
"CONFIRMFAIL":"dqrfa" "CONFIRMFAIL": "dqrfa"
} }
} }
...@@ -48,55 +49,55 @@ class TradeMarkService extends ServiceBase { ...@@ -48,55 +49,55 @@ class TradeMarkService extends ServiceBase {
* obj.colorizedPicUrl 商标彩色图样, * obj.colorizedPicUrl 商标彩色图样,
* obj.user 用户数据 * obj.user 用户数据
*/ */
async updateTmInfo(obj){ async updateTmInfo(obj) {
var user = obj.user; var user = obj.user;
if(!user || !user.id){ if (!user || !user.id) {
return system.getResultFail(-100, "未知用户"); return system.getResultFail(-100, "未知用户");
} }
var deliveryOrderNo = obj.deliveryOrderNo; var deliveryOrderNo = obj.deliveryOrderNo;
if(!deliveryOrderNo){ if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误"); return system.getResultFail(-101, "deliveryOrderNo参数错误");
} }
// 1.获取交付单信息 // 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({ var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo}, where: { deliveryOrderNo: deliveryOrderNo },
raw:true raw: true
}); });
if(!ordertmproduct || !ordertmproduct.id){ if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在"); return system.getResultFail(-102, "商标交付单不存在");
} }
// 2.获取交付单状态,判断是否可修改 // 2.获取交付单状态,判断是否可修改
if(ordertmproduct.deliveryStatus=='ddj' || ordertmproduct.deliveryStatus=='ywc'){ if (ordertmproduct.deliveryStatus == 'ddj' || ordertmproduct.deliveryStatus == 'ywc') {
var deliveryStatusName = "待递交"; var deliveryStatusName = "待递交";
if(ordertmproduct.deliveryStatus=='ywc'){ if (ordertmproduct.deliveryStatus == 'ywc') {
deliveryStatusName="已完成"; deliveryStatusName = "已完成";
} }
return system.getResultFail(-103, "该商标交付单状态为"+deliveryStatusName+",不能进行修改"); return system.getResultFail(-103, "该商标交付单状态为" + deliveryStatusName + ",不能进行修改");
} }
var self = this; var self = this;
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var otpObj={ var otpObj = {
id:ordertmproduct.id, id: ordertmproduct.id,
deliveryOrderNo:deliveryOrderNo, deliveryOrderNo: deliveryOrderNo,
updateuser_id:user.id, updateuser_id: user.id,
updateuser:user.nickname updateuser: user.nickname
}; };
if(obj.picUrl){//商标图样 黑白 if (obj.picUrl) {//商标图样 黑白
otpObj["picUrl"]=obj.picUrl; otpObj["picUrl"] = obj.picUrl;
} }
if(obj.colorizedPicUrl){//彩色商标图样 if (obj.colorizedPicUrl) {//彩色商标图样
otpObj["colorizedPicUrl"]=obj.colorizedPicUrl; otpObj["colorizedPicUrl"] = obj.colorizedPicUrl;
} }
if(obj.tmName){//商标名称 if (obj.tmName) {//商标名称
otpObj["tmName"]=obj.tmName; otpObj["tmName"] = obj.tmName;
} }
if(obj.tmFormType){//商标类型 if (obj.tmFormType) {//商标类型
otpObj["tmFormType"]=obj.tmFormType; otpObj["tmFormType"] = obj.tmFormType;
} }
if(obj.notes){//商标说明 if (obj.notes) {//商标说明
otpObj["notes"]=obj.notes; otpObj["notes"] = obj.notes;
} }
await self.ordertmproductSve.dao.update(otpObj,t);//商标交付单 修改商标图样 await self.ordertmproductSve.dao.update(otpObj, t);//商标交付单 修改商标图样
return system.getResultSuccess(); return system.getResultSuccess();
}) })
} }
...@@ -110,87 +111,87 @@ class TradeMarkService extends ServiceBase { ...@@ -110,87 +111,87 @@ class TradeMarkService extends ServiceBase {
* obj.nclSmallCodes 商标尼斯小类数组 * obj.nclSmallCodes 商标尼斯小类数组
* obj.user 用户数据 * obj.user 用户数据
*/ */
async updateNclInfo(obj){ async updateNclInfo(obj) {
var user = obj.user; var user = obj.user;
var self = this; var self = this;
if(!user || !user.id){ if (!user || !user.id) {
return system.getResultFail(-100, "未知用户"); return system.getResultFail(-100, "未知用户");
} }
var deliveryOrderNo = obj.deliveryOrderNo; var deliveryOrderNo = obj.deliveryOrderNo;
if(!deliveryOrderNo){ if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误"); return system.getResultFail(-101, "deliveryOrderNo参数错误");
} }
// 1.获取交付单信息 // 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({ var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo}, where: { deliveryOrderNo: deliveryOrderNo },
raw:true raw: true
}); });
if(!ordertmproduct || !ordertmproduct.id){ if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在"); return system.getResultFail(-102, "商标交付单不存在");
} }
// 2.获取交付单状态,判断是否可修改 // 2.获取交付单状态,判断是否可修改
if(ordertmproduct.deliveryStatus=='ddj' || ordertmproduct.deliveryStatus=='ywc'){ if (ordertmproduct.deliveryStatus == 'ddj' || ordertmproduct.deliveryStatus == 'ywc') {
var deliveryStatusName = "待递交"; var deliveryStatusName = "待递交";
if(ordertmproduct.deliveryStatus=='ywc'){ if (ordertmproduct.deliveryStatus == 'ywc') {
deliveryStatusName="已完成"; deliveryStatusName = "已完成";
} }
return system.getResultFail(-103, "该商标交付单状态为"+deliveryStatusName+",不能进行修改"); return system.getResultFail(-103, "该商标交付单状态为" + deliveryStatusName + ",不能进行修改");
} }
var tbCode = obj.tbCode; var tbCode = obj.tbCode;
if(!tbCode){ if (!tbCode) {
return system.getResultFail(-104, "tbCode参数错误"); return system.getResultFail(-104, "tbCode参数错误");
} }
//获取商标尼斯信息 //获取商标尼斯信息
var tm = await this.dao.model.findOne({ var tm = await this.dao.model.findOne({
where:{tbCode:tbCode}, where: { tbCode: tbCode },
raw:true raw: true
}); });
if(!tm || !tm.id){ if (!tm || !tm.id) {
return system.getResultFail(-105, "尼斯信息不存在"); return system.getResultFail(-105, "尼斯信息不存在");
} }
//获取交付单下其它商标尼斯信息 //获取交付单下其它商标尼斯信息
var othertm = await this.dao.model.findAll({ var othertm = await this.dao.model.findAll({
where:{ where: {
deliveryOrderNo:deliveryOrderNo, deliveryOrderNo: deliveryOrderNo,
tbCode: { [self.db.Op.ne]: tbCode } tbCode: { [self.db.Op.ne]: tbCode }
}, },
raw:true raw: true
}); });
if(!obj.nclOneCodes){ if (!obj.nclOneCodes) {
return system.getResultFail(-106, "nclOneCodes参数错误"); return system.getResultFail(-106, "nclOneCodes参数错误");
} }
if(!obj.nclSmallCodes || obj.nclSmallCodes.length<1){ if (!obj.nclSmallCodes || obj.nclSmallCodes.length < 1) {
return system.getResultFail(-107, "nclSmallCodes参数错误"); return system.getResultFail(-107, "nclSmallCodes参数错误");
} }
if(obj.nclSmallCodes.length>10){ if (obj.nclSmallCodes.length > 10) {
return system.getResultFail(-108, "尼斯小类不能超过10项"); return system.getResultFail(-108, "尼斯小类不能超过10项");
} }
var nclOneCodes2 = obj.nclOneCodes; var nclOneCodes2 = obj.nclOneCodes;
for(var i=0;i<othertm.length;i++){//判断重复大类 for (var i = 0; i < othertm.length; i++) {//判断重复大类
var other = othertm[i]; var other = othertm[i];
if(other.nclOneCodes==obj.nclOneCodes){ if (other.nclOneCodes == obj.nclOneCodes) {
return system.getResultFail(-109, "该商标存在重复的尼斯大类"); return system.getResultFail(-109, "该商标存在重复的尼斯大类");
}else{ } else {
nclOneCodes2=nclOneCodes2+","+other.nclOneCodes; nclOneCodes2 = nclOneCodes2 + "," + other.nclOneCodes;
} }
} }
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var tmObj={ var tmObj = {
id:tm.id, id: tm.id,
nclOneCodes:obj.nclOneCodes, nclOneCodes: obj.nclOneCodes,
nclSmallCodes: JSON.stringify(obj.nclSmallCodes), nclSmallCodes: JSON.stringify(obj.nclSmallCodes),
updateuser_id:user.id, updateuser_id: user.id,
updateuser:user.nickname updateuser: user.nickname
}; };
await self.dao.update(tmObj,t);//修改商标尼斯信息 await self.dao.update(tmObj, t);//修改商标尼斯信息
var otpObj={ var otpObj = {
id:ordertmproduct.id, id: ordertmproduct.id,
nclOneCodes:nclOneCodes2, nclOneCodes: nclOneCodes2,
updateuser_id:user.id, updateuser_id: user.id,
updateuser:user.nickname updateuser: user.nickname
}; };
await self.ordertmproductSve.dao.update(otpObj,t);//商标交付单 修改大类列表 await self.ordertmproductSve.dao.update(otpObj, t);//商标交付单 修改大类列表
return system.getResultSuccess(); return system.getResultSuccess();
}) })
} }
...@@ -210,7 +211,7 @@ class TradeMarkService extends ServiceBase { ...@@ -210,7 +211,7 @@ class TradeMarkService extends ServiceBase {
* obj.officialFileName 官文文件名称 , * obj.officialFileName 官文文件名称 ,
* obj.officialFileUrl 官文文件地址 , * obj.officialFileUrl 官文文件地址 ,
*/ */
async receiveTmOfficialData(obj){ async receiveTmOfficialData(obj) {
// return system.getResultFail(-100, "接口开发中"); // return system.getResultFail(-100, "接口开发中");
// var user = obj.user; // var user = obj.user;
// var app = obj.app; // var app = obj.app;
...@@ -219,60 +220,60 @@ class TradeMarkService extends ServiceBase { ...@@ -219,60 +220,60 @@ class TradeMarkService extends ServiceBase {
// return system.getResultFail(-100, "未知用户"); // return system.getResultFail(-100, "未知用户");
// } // }
var deliveryOrderNo = obj.deliveryOrderNo; var deliveryOrderNo = obj.deliveryOrderNo;
if(!deliveryOrderNo){ if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误"); return system.getResultFail(-101, "deliveryOrderNo参数错误");
} }
// 1.获取交付单信息 // 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({ var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo}, where: { deliveryOrderNo: deliveryOrderNo },
raw:true raw: true
}); });
if(!ordertmproduct || !ordertmproduct.id){ if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在"); return system.getResultFail(-102, "商标交付单不存在");
} }
// if(!app){ // if(!app){
// return system.getResultFail(-103, "未知应用"); // return system.getResultFail(-103, "未知应用");
// } // }
var tbCode = obj.tbCode; var tbCode = obj.tbCode;
if(!tbCode){ if (!tbCode) {
return system.getResultFail(-104, "tbCode参数错误"); return system.getResultFail(-104, "tbCode参数错误");
} }
//获取商标尼斯信息 //获取商标尼斯信息
var tm = await this.dao.model.findOne({ var tm = await this.dao.model.findOne({
where:{tbCode:tbCode,deliveryOrderNo:deliveryOrderNo}, where: { tbCode: tbCode, deliveryOrderNo: deliveryOrderNo },
raw:true raw: true
}); });
if(!tm || !tm.id){ if (!tm || !tm.id) {
return system.getResultFail(-105, "尼斯信息不存在"); return system.getResultFail(-105, "尼斯信息不存在");
} }
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var tmObj={ var tmObj = {
id:tm.id id: tm.id
}; };
var officialObj={ var officialObj = {
app_id:ordertmproduct.app_id app_id: ordertmproduct.app_id
}; };
if(obj.officialType){ if (obj.officialType) {
if(self.statusConvertJSON[obj.officialType]){ if (self.statusConvertJSON[obj.officialType]) {
tmObj["officialType"]=self.statusConvertJSON[obj.officialType]; tmObj["officialType"] = self.statusConvertJSON[obj.officialType];
officialObj["officialType"] = self.statusConvertJSON[obj.officialType]; officialObj["officialType"] = self.statusConvertJSON[obj.officialType];
} }
} }
if(obj.tmRegistNum){ if (obj.tmRegistNum) {
officialObj["tmRegistNum"] = obj.tmRegistNum; officialObj["tmRegistNum"] = obj.tmRegistNum;
tmObj["tmRegistNum"]=obj.tmRegistNum; tmObj["tmRegistNum"] = obj.tmRegistNum;
} }
await self.dao.update(tmObj,t);//修改商标状态信息 await self.dao.update(tmObj, t);//修改商标状态信息
if(officialObj["tmRegistNum"] && officialObj["officialType"]){ if (officialObj["tmRegistNum"] && officialObj["officialType"]) {
if(obj.officialFileName){ if (obj.officialFileName) {
officialObj["officialFileName"] = obj.officialFileName; officialObj["officialFileName"] = obj.officialFileName;
} }
if(obj.officialFileUrl){ if (obj.officialFileUrl) {
officialObj["officialFileUrl"] = obj.officialFileUrl; officialObj["officialFileUrl"] = obj.officialFileUrl;
} }
var code = await self.getBusUid("tmoff"); var code = await self.getBusUid("tmoff");
officialObj["code"]=code; officialObj["code"] = code;
await self.tmofficialDao.create(officialObj,t); await self.tmofficialDao.create(officialObj, t);
} }
return system.getResultSuccess(); return system.getResultSuccess();
}) })
...@@ -281,57 +282,67 @@ class TradeMarkService extends ServiceBase { ...@@ -281,57 +282,67 @@ class TradeMarkService extends ServiceBase {
* 辅助商标状态修改 * 辅助商标状态修改
* @param {*} obj * @param {*} obj
*/ */
async updateAssistTmStatus(obj){ async updateAssistTmStatus(obj) {
var self = this; var self = this;
var deliveryOrderNo = obj.channelOrderNum; var deliveryOrderNo = obj.channelOrderNum;
if(!deliveryOrderNo){ if (!deliveryOrderNo) {
return system.getResultFail(-101, "deliveryOrderNo参数错误"); return system.getResultFail(-101, "deliveryOrderNo参数错误");
} }
// 1.获取交付单信息 // 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({ var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo}, where: { deliveryOrderNo: deliveryOrderNo },
raw:true raw: true
}); });
if(!ordertmproduct || !ordertmproduct.id){ if (!ordertmproduct || !ordertmproduct.id) {
return system.getResultFail(-102, "商标交付单不存在"); return system.getResultFail(-102, "商标交付单不存在");
} }
var tbCode = obj.proxyCode; var tbCode = obj.proxyCode;
if(!tbCode){ if (!tbCode) {
return system.getResultFail(-104, "tbCode参数错误"); return system.getResultFail(-104, "tbCode参数错误");
} }
//获取商标尼斯信息 //获取商标尼斯信息
var tm = await this.dao.model.findOne({ var tm = await this.dao.model.findOne({
where:{tbCode:tbCode,deliveryOrderNo:deliveryOrderNo}, where: { tbCode: tbCode, deliveryOrderNo: deliveryOrderNo },
raw:true raw: true
}); });
if(!tm || !tm.id){ if (!tm || !tm.id) {
return system.getResultFail(-105, "商标信息不存在"); return system.getResultFail(-105, "商标信息不存在");
} }
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var tmObj={id:tm.id}; var tmObj = { id: tm.id };
var otp = {id:ordertmproduct.id}; var otp = { id: ordertmproduct.id };
if(obj.tmStatus){ if (obj.tmStatus) {
if(self.statusConvertJSON[obj.tmStatus]){ if (self.statusConvertJSON[obj.tmStatus]) {
tmObj["officialType"]=self.statusConvertJSON[obj.tmStatus]; tmObj["officialType"] = self.statusConvertJSON[obj.tmStatus];
} }
if(tmObj.officialType && ",dqrfa,dsccl,dsh,ddj,ydj,ywc,".indexOf(tmObj.officialType)>=0){ if (tmObj.officialType && ",dqrfa,dsccl,dsh,ddj,ydj,ywc,".indexOf(tmObj.officialType) >= 0) {
otp["deliveryStatus"]=tmObj.officialType; otp["deliveryStatus"] = tmObj.officialType;
await self.ordertmproductSve.update(otp,t); await self.ordertmproductSve.update(otp, t);
} }
// {"dqrfa":"待确认方案", "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" }, // {"dqrfa":"待确认方案", "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" },
} }
if(obj.opNotes){ if (obj.opNotes) {
tmObj["opNotes"]=obj.opNotes; tmObj["opNotes"] = obj.opNotes;
} }
if(obj.submitTime){ if (obj.submitTime) {
tmObj["submitTime"]=obj.submitTime; tmObj["submitTime"] = obj.submitTime;
} }
if(obj.tmRegistNum){ if(obj.tmRegistNum){
tmObj["tmRegistNum"]=obj.tmRegistNum; tmObj["tmRegistNum"]=obj.tmRegistNum;
} }
await self.dao.update(tmObj,t);//修改商标状态信息 await self.dao.update(tmObj,t);//修改商标状态信息
var deliveryStatusName = uiconfig.config.pdict.official_type[tmObj.officialType];
var flowObj = {
isShow: 1,
app_id: ordertmproduct.app_id,
createuser_id: ordertmproduct.createuser_id,
sourceOrderNo: deliveryOrderNo,
opContent: "第" + tm.nclOneCodes + "类商标状态更新为【" + deliveryStatusName + "】" + obj.opNotes
};
await self.orderflowDao.create(flowObj, t);//创建交付流程
await self.dao.update(tmObj, t);//修改商标状态信息
return system.getResultSuccess(); return system.getResultSuccess();
}) })
} }
} }
module.exports=TradeMarkService; module.exports = TradeMarkService;
const Client = require('aliyun-api-gateway').Client; const Client = require('aliyun-api-gateway').Client;
// const client = new Client('203727307', 'b6za34qem6k9a3s3jguvh24nc3ridlnh');
const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn'); // const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');
const client = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');
class aliyunClient { class aliyunClient {
constructor() { constructor() {
// this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard"; // this.aliReqUrl = "https://aliapi.gongsibao.com/tm/springboard";
......
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