Ver código fonte

新增导出编码排序

olym 7 anos atrás
pai
commit
4d29a31d93

+ 2 - 2
modules/ration_repository/models/ration_item.js

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

+ 0 - 0
public/tmp/test.md