Commit 52d0f93a by 王悦

add强制更新

parent e18206a2
...@@ -28,6 +28,9 @@ class ProductAPI extends APIBase { ...@@ -28,6 +28,9 @@ class ProductAPI extends APIBase {
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;
case "forceUpdate":
opResult = await this.trademarkTransactionSve.forceUpdate(pobj, pobj.actionBody);
break;
case "tmListInfo": // 2020 0903 lin 新增 标原管理 case "tmListInfo": // 2020 0903 lin 新增 标原管理
opResult = await this.trademarkTransactionSve.tmListInfo(pobj, pobj.actionBody); opResult = await this.trademarkTransactionSve.tmListInfo(pobj, pobj.actionBody);
break; break;
......
...@@ -704,6 +704,29 @@ class TrademarktransactionService extends ServiceBase { ...@@ -704,6 +704,29 @@ class TrademarktransactionService extends ServiceBase {
} }
} }
} }
async forceUpdate(pobj, status) {
let item = await this.dao.model.findOne({id:pobj.id})
item.platform_quoted_price = pobj.price
let obj = buildobj(item,status)
if (obj) {
let err = await reqbyget({
action:"ForceUploadTrademarkOnsale",
reqbody: obj
})
if (err){
item.fail_reason = err
item.publish_status = "fail"
item.publish_status_name = "发布失败"
item.save()
return system.getResultError(err)
}else {
item.publish_status = "uppershelf"
item.publish_status_name ="在售"
item.save()
}
return system.getResultSuccess()
}
}
/** /**
* @api {post} /tmtransaction/action/trademarktransaction/springBoard 修改 * @api {post} /tmtransaction/action/trademarktransaction/springBoard 修改
* @apiGroup 标源管理 * @apiGroup 标源管理
......
...@@ -38,6 +38,8 @@ exports.buildobj=(sqlobj,status)=>{ ...@@ -38,6 +38,8 @@ exports.buildobj=(sqlobj,status)=>{
try { try {
if (!sqlobj.tm_ncl_third || !sqlobj.tm_group) if (!sqlobj.tm_ncl_third || !sqlobj.tm_group)
return null return null
if (sqlobj.ncl_one_code.length===1)
sqlobj.ncl_one_code = "0"+sqlobj.ncl_one_code
return { return {
"beginTime": 1574388139000, "beginTime": 1574388139000,
"classificationCode": sqlobj.ncl_one_code, "classificationCode": sqlobj.ncl_one_code,
......
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