|
|
@@ -12,6 +12,7 @@ import async from 'async';
|
|
|
let stdRationModel = require ('../../ration_repository/models/ration_item').Model;
|
|
|
let counter = require('../../../public/counter/counter');
|
|
|
const scMathUtil = require('../../../public/scMathUtil').getUtil();
|
|
|
+let gljUtil = require('../../../public/gljUtil');
|
|
|
|
|
|
class CompleRatoinDao {
|
|
|
async updateRation(userID, compilationId, updateData, callback){
|
|
|
@@ -157,8 +158,8 @@ class CompleRatoinDao {
|
|
|
if(comGljIds.length > 0) {
|
|
|
comGljs = await complementaryGljModel.find({userId: userId, ID: {$in: comGljIds}});
|
|
|
}
|
|
|
- let gljDatas = stdGljs.concat(comGljs);
|
|
|
- gljDatas.sort(function (a, b) {
|
|
|
+ let gljDatas = gljUtil.sortRationGLJ(stdGljs.concat(comGljs),true);
|
|
|
+ /* gljDatas.sort(function (a, b) {
|
|
|
let aV = a.gljType + a.code,
|
|
|
bV = b.gljType + b.code;
|
|
|
if(aV > bV) {
|
|
|
@@ -167,7 +168,7 @@ class CompleRatoinDao {
|
|
|
return -1;
|
|
|
}
|
|
|
return 0;
|
|
|
- });
|
|
|
+ });*/
|
|
|
if(ration.jobContent && ration.jobContent.toString().trim() !== ''){
|
|
|
hintsArr.push(`<label class="nomargin font_blue">工作内容:`);
|
|
|
hintsArr = hintsArr.concat(ration.jobContent.split('\n'));
|
|
|
@@ -245,8 +246,8 @@ class CompleRatoinDao {
|
|
|
if(stdGljIds.length > 0) {
|
|
|
stdGljs = await stdGljModel.find({ID: {$in: stdGljIds}});
|
|
|
}
|
|
|
- let gljDatas = stdGljs;
|
|
|
- gljDatas.sort(function (a, b) {
|
|
|
+ let gljDatas = gljUtil.sortRationGLJ(stdGljs,true);
|
|
|
+ /* gljDatas.sort(function (a, b) {
|
|
|
let aV = a.gljType + a.code,
|
|
|
bV = b.gljType + b.code;
|
|
|
if(aV > bV) {
|
|
|
@@ -255,7 +256,8 @@ class CompleRatoinDao {
|
|
|
return -1;
|
|
|
}
|
|
|
return 0;
|
|
|
- });
|
|
|
+ });*/
|
|
|
+ gljDatas = gljUtil.sortRationGLJ(gljDatas,true);
|
|
|
if(ration.jobContent && ration.jobContent.toString().trim() !== ''){
|
|
|
hintsArr.push(`<label class="nomargin font_blue">工作内容:`);
|
|
|
hintsArr = hintsArr.concat(ration.jobContent.split('\n'));
|