Commit 077e8b08 by 王悦

add new

parent baac8efc
...@@ -25,6 +25,9 @@ class ProductAPI extends APIBase { ...@@ -25,6 +25,9 @@ class ProductAPI extends APIBase {
case "tmBatchUpload": // 2020 0901 lin 新增 标源批传 case "tmBatchUpload": // 2020 0901 lin 新增 标源批传
opResult = await this.trademarkTransactionSve.tmBatchUpload(pobj, pobj.actionBody); opResult = await this.trademarkTransactionSve.tmBatchUpload(pobj, pobj.actionBody);
break; break;
case "tmAddUpload": // 2020 0901 lin 新增 标源批传
opResult = await this.trademarkTransactionSve.tmAddUpload(pobj, pobj.actionBody);
break;
case "tmInfo": // 2020 0903 lin 新增 标原管理 case "tmInfo": // 2020 0903 lin 新增 标原管理
opResult = await this.trademarkTransactionSve.tmInfo(pobj, pobj.actionBody); opResult = await this.trademarkTransactionSve.tmInfo(pobj, pobj.actionBody);
break; break;
......
...@@ -73,6 +73,8 @@ module.exports = (db, DataTypes) => { ...@@ -73,6 +73,8 @@ module.exports = (db, DataTypes) => {
type: DataTypes.STRING, //转让类型 type: DataTypes.STRING, //转让类型
reason: DataTypes.STRING, //转让原因 reason: DataTypes.STRING, //转让原因
fail_reason: DataTypes.STRING, //失败原因 fail_reason: DataTypes.STRING, //失败原因
TradeTmDetailJson: DataTypes.JSON,
TmType: DataTypes.STRING, // 商标标签: NORMAL: 普通标 (不传默认普通) STORY:故事商标 BARGAIN:特价 SELECTED:甄选
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -299,7 +299,25 @@ class TrademarktransactionService extends ServiceBase { ...@@ -299,7 +299,25 @@ class TrademarktransactionService extends ServiceBase {
} }
return system.getResultSuccess(data); return system.getResultSuccess(data);
} }
//甄选特价品牌商标的上传
async tmAddUpload(pobj, actionbody) {
if (!pobj || !actionbody) {
return system.getResultFail(-101, "actionBody is empty");
}
let objlist = await this.addbaseinfo([actionbody]);
let res = "ok"
for (var i = 0; i < objlist.length; i++) {
// 2020 0910 lin 新增 platform_quoted_price = business_quoted_price * 1.2 + 1000
objlist[i].platform_quoted_price = Number(objlist[i].business_quoted_price) * 1.2 + 1000;
if (objlist[i].id)
await this.dao.model.updateByWhere(objlist[i], {where: {id: objlist[i].id}})
else
res = await this.dao.model.create(objlist[i]);
await this.updateAlistatus([objlist[i].id||res.id])
}
var data = res
return system.getResultSuccess(data);
}
/** /**
* @api {post} /tmtransaction/action/trademarktransaction/springBoard 标原列表 * @api {post} /tmtransaction/action/trademarktransaction/springBoard 标原列表
* @apiGroup 标源管理 * @apiGroup 标源管理
...@@ -417,6 +435,10 @@ class TrademarktransactionService extends ServiceBase { ...@@ -417,6 +435,10 @@ class TrademarktransactionService extends ServiceBase {
whereObj["publish_status"] = ab.publish_status; whereObj["publish_status"] = ab.publish_status;
countObj["publish_status"] = ab.publish_status; countObj["publish_status"] = ab.publish_status;
} }
if (ab.TmType) {// publish_status
whereObj["TmType"] = ab.TmType;
countObj["TmType"] = ab.TmType;
}
var count = await this.dao.findCount({ where: countObj }); var count = await this.dao.findCount({ where: countObj });
var list = await this.dao.model.findAll({ var list = await this.dao.model.findAll({
where: whereObj, where: whereObj,
...@@ -431,7 +453,7 @@ class TrademarktransactionService extends ServiceBase { ...@@ -431,7 +453,7 @@ class TrademarktransactionService extends ServiceBase {
"contacts",//联系人 "contacts",//联系人
"mobile",//联系电话 "mobile",//联系电话
"name",//商标名称 "name",//商标名称
"trademark_type_name", "TmType",
"ncl_one_code", "ncl_one_code",
"channel_name", "channel_name",
"tm_applier", "tm_applier",
......
...@@ -41,7 +41,7 @@ exports.buildobj=(sqlobj,status)=>{ ...@@ -41,7 +41,7 @@ exports.buildobj=(sqlobj,status)=>{
return null return null
if (sqlobj.ncl_one_code.length===1) if (sqlobj.ncl_one_code.length===1)
nclcode = "0"+nclcode nclcode = "0"+nclcode
return { let data = {
"beginTime": 1574388139000, "beginTime": 1574388139000,
"classificationCode":nclcode, "classificationCode":nclcode,
"description": JSON.parse(sqlobj.tm_ncl_third).join(","), "description": JSON.parse(sqlobj.tm_ncl_third).join(","),
...@@ -59,6 +59,11 @@ exports.buildobj=(sqlobj,status)=>{ ...@@ -59,6 +59,11 @@ exports.buildobj=(sqlobj,status)=>{
"tmName": sqlobj.name, "tmName": sqlobj.name,
"tmNumber": sqlobj.code "tmNumber": sqlobj.code
} }
if (sqlobj.TmType !== "NORMAL"){
data.TmType = sqlobj.TmType
data.TradeTmDetailJson = JSON.stringify(sqlobj.TradeTmDetailJson)
}
return data
}catch (e){ }catch (e){
return null return null
} }
......
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