|
@@ -494,7 +494,6 @@ rationItemDAO.prototype.updateAnnotation = function (lastOpr, repId, updateArr,
|
|
* @param {Object} condition
|
|
* @param {Object} condition
|
|
* @param {Object} fields
|
|
* @param {Object} fields
|
|
* @param {String} indexBy
|
|
* @param {String} indexBy
|
|
- * @param {Object} sort
|
|
|
|
* @return {Promise|Array}
|
|
* @return {Promise|Array}
|
|
*/
|
|
*/
|
|
rationItemDAO.prototype.getRationItemByCondition = async function (condition, fields = null, indexBy = null) {
|
|
rationItemDAO.prototype.getRationItemByCondition = async function (condition, fields = null, indexBy = null) {
|
|
@@ -502,7 +501,7 @@ rationItemDAO.prototype.getRationItemByCondition = async function (condition, fi
|
|
if (Object.keys(condition).length <= 0) {
|
|
if (Object.keys(condition).length <= 0) {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
- result = await rationItemModel.find(condition, fields);
|
|
|
|
|
|
+ result = await rationItemModel.find(condition, fields).sort({code: 1});
|
|
if (indexBy !== null && result.length > 0) {
|
|
if (indexBy !== null && result.length > 0) {
|
|
let tmpResult = {};
|
|
let tmpResult = {};
|
|
for(let tmp of result) {
|
|
for(let tmp of result) {
|
|
@@ -635,6 +634,7 @@ rationItemDAO.prototype.exportExcelData = async function(rationRepId) {
|
|
};
|
|
};
|
|
// @todo 限制导出的数量以防内存溢出
|
|
// @todo 限制导出的数量以防内存溢出
|
|
const rationDataList = await this.getRationItemByCondition(condition, ['name', 'code', 'ID']);
|
|
const rationDataList = await this.getRationItemByCondition(condition, ['name', 'code', 'ID']);
|
|
|
|
+
|
|
// 整理数据
|
|
// 整理数据
|
|
let rationData = [];
|
|
let rationData = [];
|
|
for (const tmp of rationDataList) {
|
|
for (const tmp of rationDataList) {
|