Skip to content

Instantly share code, notes, and snippets.

@bluemoon2014
Created April 23, 2018 03:16
Show Gist options
  • Save bluemoon2014/b85d4cdbbbf526a33673a5167231fe54 to your computer and use it in GitHub Desktop.
Save bluemoon2014/b85d4cdbbbf526a33673a5167231fe54 to your computer and use it in GitHub Desktop.
增加删除修改三合一一张表
.then(function () {
return Promise.all(bidWindSegsObjcToDeal.inserts.map(function (currentBidWinSeg) {
return bidSegSQLServer.addBidWinSegMycWrapper(currentBidWinSeg);
}));
}).then(function (bidWinSegCodes) {
//增加分标段成功
//TODO
// responseUtil.sendSuccess(res, bidWinSegCodes);
return Promise.all(bidWinSegCodes.map(function (currentCode) {
bidIssueLogInfo.businessID = currentCode;
bidIssueLogInfo.operateDesc = "增加分标段";
bidIssueLogInfo.operateTime = logUtil.getFormatByTime();
return logQKLServer.writeLogMycWrapper(deepCopyObjt(bidIssueLogInfo),txOption);
}));
}).then(function (bidWinSegCodes) {
return Promise.all(bidWinSegCodes.map(function (currentCode) {
bidIssueLogInfo.businessID = currentCode;
bidIssueLogInfo.operateDesc = "增加分标段";
bidIssueLogInfo.operateTime = logUtil.getFormatByTime();
return logSQLServer.writeLogMycWrapper(deepCopyObjt(bidIssueLogInfo));
}));
}).then(function () {
//更改
return Promise.all(bidWindSegsObjcToDeal.updates.map(function (currentBidWinSeg) {
var txContentTemp = commonUtil.join(currentBidWinSeg,BID_WIN_SEG_CONTENT_ARRAY);
return bidQKLServer.modBidSegmentMycWrapper(txContentTemp,txOption);
}));
}).then(function () {
return Promise.all(bidWindSegsObjcToDeal.updates.map(function (currentBidWinSeg) {
return bidSegSQLServer.modBidWinSegMycWrapper(currentBidWinSeg);
}));
}).then(function (bidWinSegCodes) {
return Promise.all(bidWinSegCodes.map(function (currentCode) {
bidIssueLogInfo.businessID = currentCode;
bidIssueLogInfo.operateDesc = "修改分标段";
bidIssueLogInfo.operateTime = logUtil.getFormatByTime();
return logQKLServer.writeLogMycWrapper(deepCopyObjt(bidIssueLogInfo),txOption);
}));
}).then(function (bidWinSegCodes) {
return Promise.all(bidWinSegCodes.map(function (currentCode) {
bidIssueLogInfo.businessID = currentCode;
bidIssueLogInfo.operateDesc = "修改分标段";
bidIssueLogInfo.operateTime = logUtil.getFormatByTime();
return logSQLServer.writeLogMycWrapper(deepCopyObjt(bidIssueLogInfo));
}));
}).then(function () {
//删除分标段
return Promise.all(bidWindSegsObjcToDeal.deletes.map(function (currentBidWinSeg) {
currentBidWinSeg.bidIssueCode = "null";
currentBidWinSeg.bidWinCode = "null";
return bidSegSQLServer.modBidWinSegMycWrapper(currentBidWinSeg);
}));
}).then(function (bidWinSegCodes) {
return Promise.all(bidWinSegCodes.map(function (currentCode) {
bidIssueLogInfo.businessID = currentCode;
bidIssueLogInfo.operateDesc = "删除分标段";
bidIssueLogInfo.operateTime = logUtil.getFormatByTime();
return logQKLServer.writeLogMycWrapper(deepCopyObjt(bidIssueLogInfo),txOption);
}));
}).then(function (bidWinSegCodes) {
return Promise.all(bidWinSegCodes.map(function (currentCode) {
bidIssueLogInfo.businessID = currentCode;
bidIssueLogInfo.operateDesc = "删除分标段";
bidIssueLogInfo.operateTime = logUtil.getFormatByTime();
return logSQLServer.writeLogMycWrapper(deepCopyObjt(bidIssueLogInfo));
}));
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment