Commit bb0147bb by 王勇飞

pp

parent 49775392
......@@ -54,7 +54,7 @@ class Dao {
}
orderBy() {
//return {"key":"include","value":{model:this.db.models.app}};
return [["updated_at", "DESC"]];
return [["lastUp", "DESC"]];
}
buildQuery(qobj) {
var linkAttrs = [];
......
......@@ -11,7 +11,7 @@ module.exports = {
{ "width": "60", "label": "尼斯", "prop": "nclOneCodes", "isShowTip": true, "isTmpl": false },
{ "width": "170", "label": "商标状态", "prop": "tmStatusName", "isShowTip": true, "isTmpl": false },
{ "width": "100", "label": "创建时间", "prop": "created_at", "isShowTip": true, "isTmpl": false },
{ "width": "100", "label": "更新时间", "prop": "updated_at", "isShowTip": true, "isTmpl": false },
{ "width": "100", "label": "最后回执", "prop": "lastUp", "isShowTip": true, "isTmpl": false },
{ "width": "100", "label": "提报时间", "prop": "submitTime", "isShowTip": true, "isTmpl": false },
{ "width": "70", "label": "来源", "prop": "tmSourceTypeName", "isShowTip": true, "isTmpl": false },
{ "width": "85", "label": "支付状态", "prop": "channelPayStatusName", "isShowTip": true, "isTmpl": false },
......
......@@ -120,6 +120,7 @@ module.exports = (db, DataTypes) => {
nclPublicExpense: DataTypes.DECIMAL(12, 2),
principal: DataTypes.STRING(100),//提报主体
isPushed: DataTypes.INTEGER,//是否推送(0:未推送,1:已推送)
lastUp: DataTypes.DATE,//最后一次回执更新的时间
}, {
paranoid: true,//假的删除
underscored: true,
......
......@@ -354,6 +354,8 @@ class TmFlowService extends ServiceBase {
fileName = fileName + "_" + tm.tmName + "_" + tm.nclOneCodes + "." + fileType;
var flowWhere = { where: { tmRegistNum: reg_code, tmStatus: officialType } };
var flowCount = await this.dao.findCount(flowWhere);
//获取tmFlow中回执的最新时间
let lastUp = await this.getLastUpFromTmFlow(reg_code);
await this.db.transaction(async function (t) {
var params = {
opAppId: user.app_id,
......@@ -366,10 +368,12 @@ class TmFlowService extends ServiceBase {
if (tm.tmStatus != officialType) {
var param = { tmStatus: officialType };
param.isPushed = 0; //tm状态更新
param.lastUp = lastUp; //回执最后更新时间
self.trademarkDao.updateByWhere(param, { where: { tmRegistNum: reg_code } }, t);
}
if (flowCount > 0) {
params.isPushed=0; //官文信息更新的时候tm状态也会更新
params.lastUp = lastUp; //回执最后更新时间
self.updateByWhere(params, flowWhere, t);
} else {
opResult.isMobileMsg = 1;
......@@ -676,7 +680,13 @@ class TmFlowService extends ServiceBase {
}
}
//----------------------------------推送渠道商标回执数据 结束----------------------------------------------------------------
async getLastUpFromTmFlow(tmRegistNum){
let sql = "SELECT MAX(created_at) FROM `h_tm_flow` WHERE tmRegistNum='" + tmRegistNum +"';";
let maxCreateTime = await this.dao.customQuery(sql);
let lastTime = maxCreateTime[0]['MAX(created_at)'];
console.log('lastTime--------', lastTime);
return lastTime;
}
}
module.exports = TmFlowService;
// var task=new TmFlowService();
......
......@@ -825,8 +825,8 @@
var time = date.toLocaleDateString();
return time;
}
if (column.property == "updated_at") {
var date = new Date(row["updated_at"]);
if (column.property == "lastUp") {
var date = new Date(row["lastUp"]);
var time = date.toLocaleDateString();
return time;
}
......
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