caipin 5 سال پیش
والد
کامیت
e8ef320307
2فایلهای تغییر یافته به همراه32 افزوده شده و 11 حذف شده
  1. 2 2
      app/controller/cloudEditionController.js
  2. 30 9
      app/service/cloudEditionService.js

+ 2 - 2
app/controller/cloudEditionController.js

@@ -21,8 +21,8 @@ var curingEdition= async function (req, res){
 
 
 
-    var curingList=await cloudService.getCuringList();
-    var compilationList=await cloudService.getCompilationList();
+    var curingList=await cloudService.getCuringList();	//养护用户列表
+    var compilationList=await cloudService.getCompilationList(); //编办信息
 
     var data={ 'curingList': curingList.curingList,'pageData':curingList.pageData,'compilationList':compilationList };
 

+ 30 - 9
app/service/cloudEditionService.js

@@ -10,6 +10,11 @@ const hash=require('../class/hash');
 var curingUrl ="https://yhuat.smartcost.com.cn/cld"; //'https://yhyun.smartcost.com.cn/cld';
 var buildUrl = 'https://yun.smartcost.com.cn/cld';
 
+/**
+ * 分页相关数据计算
+ * modelsTable 数据表对象
+ * parameter 设置传的参数
+ */
 var getPage= async function(modelsTable,where,currentPage,pageSize,parameter){
     var totalCount=await modelsTable.count();
     currentPage=parseInt(currentPage);
@@ -31,9 +36,27 @@ var getPage= async function(modelsTable,where,currentPage,pageSize,parameter){
 
 var cloudService={
 
-    //获得养护列表
+    
+	/**
+	 * 获得养护列表
+	 * compilation_id 编办ID
+	 */
     getCuringList: async function(compilation_id,page=1){
-        var limit=12;
+        
+    	//获得远程养护用户
+        //数据组合
+        var cid=[];
+        curingList.forEach(function(v,i){
+            cid.push(v.client_id);
+        });
+        var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
+        var clientList = await models.CLD_client.findAllInCid(cid,attributes);
+    	
+    	
+    	
+    	
+    	//获得本地用户
+    	var limit=12;
         var offset=0;
         if(page!=1){
             var pg=page-1;
@@ -51,14 +74,12 @@ var cloudService={
         var curingList = await models.cloud_curing.findAll(option);
         var parameter='?compilation_id='+compilation_id;
         var pageData = await getPage(models.cloud_curing,option.where,page,limit,parameter);
-        //数据组合
-        var cid=[];
-        curingList.forEach(function(v,i){
-            cid.push(v.client_id);
-        });
-        var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
-        var clientList = await models.CLD_client.findAllInCid(cid,attributes);
+        
+        
+        
 
+        
+        //组合页面需要展示的数据
         curingList.forEach(function(v,i){
             curingList[i].clientInfo={};
             clientList.forEach(function(clientVal,clientI){