Преглед на файлове

Merge branch 'master' of http://git.cc-lotus.info/financial_platform/service-financial

wq преди 4 години
родител
ревизия
2b5e5fa31c

+ 16 - 3
app/controller/.intelligentFollow.js

@@ -7,7 +7,13 @@ module.exports = {
         'accept_time',
         'credit_money',
         'credit_time',
-        '!creditStatus'
+        '!creditStatus',
+        'uuid',
+        'senhemessage',
+        'jindiaomessage',
+        'sxcpname',
+        'sxhowlong',
+        'sxcplilue'
       ]
     },
     destroy: {
@@ -23,7 +29,13 @@ module.exports = {
         'accept_time',
         'credit_money',
         'credit_time',
-        'creditStatus'
+        'creditStatus',
+        'uuid',
+        'senhemessage',
+        'jindiaomessage',
+        'sxcpname',
+        'sxhowlong',
+        'sxcplilue'
       ]
     },
     show: {
@@ -36,7 +48,8 @@ module.exports = {
       parameters: {
         query: {
           intelligentId:'intelligentId',
-          uid:'uid'
+          uid:'uid',
+          uuid:'uuid',
         }
       },
       service: 'query',

+ 1 - 1
app/controller/.tPolicyDeclaration.js

@@ -20,7 +20,7 @@ module.exports = {
             'current_approval_id',
             'current_approval',
             'approval_info',
-            '!image',
+            'image',
             'create_time',
             'update_time',
             'enclosure'

+ 6 - 0
app/controller/tGovernmentStatistics.js

@@ -85,6 +85,12 @@ class TGovernmentStatisticsController extends Controller {
         this.ctx.ok({ data: res });
     }
 
+    // 银行统计
+    async bank() {
+        const res = await this.service.bank(this.ctx.query);
+        this.ctx.ok({ ...res });
+    }
+
 }
 
 module.exports = CrudController(TGovernmentStatisticsController, meta);

+ 5 - 5
app/model/intelligentDocking.js

@@ -11,13 +11,13 @@ const info = new Schema({
 const IntelligentDockingSchema = {
   uid: { type: String, required: true, maxLength: 200 }, // 企业用户id
   // 对接需求
-  company_name: { type: String, required: false, maxLength: 200 }, // 企业名称
+  company_name: { type: String, required: true, maxLength: 200 }, // 企业名称
   code: { type: String, required: false, maxLength: 200 }, // 统一社会信用代码
-  person: { type: String, required: false, maxLength: 200 }, // 联系人
-  phone: { type: String, required: false, maxLength: 200 }, // 手机号
+  person: { type: String, required: true, maxLength: 200 }, // 联系人
+  phone: { type: String, required: true, maxLength: 200 }, // 手机号
   opening_bank: { type: String, required: false, maxLength: 200 }, // 首选开户行
-  orientation: { type: [ String ], required: false }, // 融资取向
-  money: { type: String, required: false, maxLength: 200 }, // 融资金额
+  orientation: { type: [ String ], required: true }, // 融资取向
+  money: { type: String, required: true, maxLength: 200 }, // 融资金额
   claims_min_term: { type: String, required: false, maxLength: 200 }, // 融资期限(小)
   claims_max_term: { type: String, required: false, maxLength: 200 }, // 融资期限(大)
   mongey_min_rate: { type: String, required: false, maxLength: 200 }, // 融资利率(小)

+ 4 - 0
app/model/intelligentFollow.js

@@ -17,6 +17,10 @@ const IntelligentFollowSchema = {
   senhemessage: { type: String, maxLength: 200 }, // 审核信息
   jindiaomessage: { type: String, maxLength: 200 }, // 尽调信息
   refusemessage: { type: String, maxLength: 200 }, // 尽调信息
+
+  sxcpname: { type: String, maxLength: 200 }, // 授信产品名称
+  sxhowlong: { type: String, maxLength: 200 }, // 授信期限
+  sxcplilue: { type: String, maxLength: 200 }, // 授信产品利率
 };
 
 

+ 1 - 1
app/model/tPolicyDeclaration.js

@@ -41,7 +41,7 @@ const TPolicyDeclarationSchema = {
     current_approval: {type: String, default: ''},//审批人
     approval_info: {type: [approvalInfo], required: false}, // 审批信息
     enclosure: {type: [enclosure], required: false}, // 附件
-    image: {type: String, required: true},//图片
+    image: {type: String, required: false},//图片
     create_time: {type: Number, default: Date.now},//创建时间
     update_time: {type: Number, default: Date.now},//更新时间
 };

+ 1 - 0
app/router.js

@@ -170,6 +170,7 @@ module.exports = app => {
   router.get('/api/financial/tGovernmentStatistics/financialProducts', controller.tGovernmentStatistics.financialProducts);
   router.get('/api/financial/tGovernmentStatistics/financialInstitution', controller.tGovernmentStatistics.financialInstitution);
   router.get('/api/financial/tGovernmentStatistics/pageSelect', controller.tGovernmentStatistics.pageSelect);
+  router.get('/api/financial/tGovernmentStatistics/bank', controller.tGovernmentStatistics.bank);
   router.resources('tGovernmentStatistics', '/api/financial/tGovernmentStatistics', controller.tGovernmentStatistics); // index、create、show、destroy
   router.post('tGovernmentStatistics', '/api/financial/tGovernmentStatistics/update/:id', controller.tGovernmentStatistics.update);
 

+ 11 - 0
app/service/companyidentify.js

@@ -17,6 +17,17 @@ class CompanyidentifyService extends CrudService {
     this.dmodel = this.ctx.model.Dictionary;
   }
 
+  // 重写创建方法
+  async create(data) {
+    const { uid, company_name, reg_num, type, address, business, capital, establish_date, valid_period, person, opening_bank } = data;
+    assert(company_name && reg_num && type && address && business && capital && establish_date && valid_period && person && opening_bank, '缺少部分信息项');
+
+    const res = await this.model.create(data);
+    // 给用户发送消息告知注册成功
+    this.ctx.service.viewnews.insertViewNews('认证成功', '恭喜您认证成功', res._id);
+    return res;
+  }
+
   // 修改企业认证信息表的状态
   async status({ id }, { status }) {
     // 根据id查询企业认证信息表的数据

+ 10 - 1
app/service/intelligentFollow.js

@@ -79,7 +79,7 @@ class IntelligentFollowService extends CrudService {
 
   // 授信接口
   async getCredit(data) {
-    const { id, money, creditStatus, senhemessage, jindiaomessage } = data;// id:关注ID money:授信额度  orcredit:状态,senhemessage:审核备注,jindiaomessage:尽调备注
+    const { id, money, creditStatus, senhemessage, jindiaomessage, sxcpname, sxhowlong, sxcplilue } = data;// id:关注ID money:授信额度  orcredit:状态,senhemessage:审核备注,jindiaomessage:尽调备注
     const now = new Date();
     const nowtime = now.getTime();// 当前时间戳(授信时间)
     const intelligentFollow = await this.model.findById(id);
@@ -100,6 +100,15 @@ class IntelligentFollowService extends CrudService {
     if (money) {
       intelligentFollow.credit_money = parseInt(money);
     }
+    if (sxcpname) {
+      intelligentFollow.sxcpname = sxcpname;
+    }
+    if (sxhowlong) {
+      intelligentFollow.sxhowlong = sxhowlong;
+    }
+    if (sxcplilue) {
+      intelligentFollow.sxcplilue = sxcplilue;
+    }
     // 状态
     intelligentFollow.creditStatus = creditStatus;
     const creattime = new Date(intelligentFollow.meta.createdAt).getTime();// 创建时间时的时间戳

Файловите разлики са ограничени, защото са твърде много
+ 1186 - 0
app/service/tGovernmentStatistics.js


+ 322 - 0
app/service/tNewAssign.js

@@ -342,6 +342,73 @@ class TNewAssignService extends CrudService {
 
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "t_finance_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [   {
+                                                        $eq: ['$finceType', "0"]
+                                                    },
+                                                        {
+                                                            $eq: ['$finceId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "t_finance_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    use: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    project_status: 1,
+                    remarks: 1,
+                    cdata: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    finance_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$t_finance_follows"
+                                }, 0]
+                            },
+                            then: {orcredit:"9"},
+                            else : { $arrayElemAt: [ "$t_finance_follows", 0 ] },
+                        }
+                    },
+
+                }
+            },
             {
                 $match: match,
 
@@ -617,6 +684,73 @@ class TNewAssignService extends CrudService {
 
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "t_finance_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [   {
+                                                        $eq: ['$finceType', "0"]
+                                                    },
+                                                        {
+                                                            $eq: ['$finceId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "t_finance_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    use: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    project_status: 1,
+                    remarks: 1,
+                    cdata: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    finance_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$t_finance_follows"
+                                }, 0]
+                            },
+                            then: {orcredit:"9"},
+                            else : { $arrayElemAt: [ "$t_finance_follows", 0 ] },
+                        }
+                    },
+
+                }
+            },
             {
                 $match: match,
 
@@ -945,6 +1079,100 @@ class TNewAssignService extends CrudService {
                     when: 1,
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "intelligent_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [
+                                                        {
+                                                            $eq: ['$intelligentId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "intelligent_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    intelligent_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$intelligent_follows"
+                                }, 0]
+                            },
+                            then: {creditStatus:"9"},
+                            else : { $arrayElemAt: [ "$intelligent_follows", 0 ] },
+                        }
+                    },
+                }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    finance_follow: {orcredit:"$intelligent_follow.creditStatus"},
+                }
+            },
             {
                 $match: match,
 
@@ -1219,6 +1447,100 @@ class TNewAssignService extends CrudService {
                     when: 1,
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "intelligent_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [
+                                                        {
+                                                            $eq: ['$intelligentId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "intelligent_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    intelligent_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$intelligent_follows"
+                                }, 0]
+                            },
+                            then: {creditStatus:"9"},
+                            else : { $arrayElemAt: [ "$intelligent_follows", 0 ] },
+                        }
+                    },
+                }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    finance_follow: {orcredit:"$intelligent_follow.creditStatus"},
+                }
+            },
             {
                 $match: match,
 

+ 526 - 0
app/service/tUrgeHandle.js

@@ -342,6 +342,175 @@ class TUrgeHandleService extends CrudService {
 
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "t_finance_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [   {
+                                                        $eq: ['$finceType', "0"]
+                                                    },
+                                                        {
+                                                            $eq: ['$finceId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "t_finance_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    use: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    project_status: 1,
+                    remarks: 1,
+                    cdata: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    finance_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$t_finance_follows"
+                                }, 0]
+                            },
+                            then: {
+                                orcredit: "9",
+                                credit_time: {
+                                    $toDouble: "$meta.createdAt"
+                                }
+                            },
+                            else : {
+                                $arrayElemAt: ["$t_finance_follows", 0]
+                            },
+
+                        }
+                    },
+                    demand_time: {
+                        $toDouble: "$meta.createdAt"
+                    },
+
+                }
+            },
+            {
+                $addFields: {
+                    current_time: Date.now(),
+
+                }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    use: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    project_status: 1,
+                    remarks: 1,
+                    cdata: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    finance_follow: 1,
+                    demand_time: 1,
+                    current_time: 1,
+                    next_is_timeout: {
+                        $switch:
+                            {
+                                branches: [
+                                    {
+                                        case: {
+                                            $eq: ['$finance_follow.orcredit', '9']
+                                        },
+                                        then: {
+                                            $cond: {
+                                                if : {
+                                                    $gt: [{ $subtract: [ '$current_time', '$finance_follow.credit_time' ] }, 86400000]
+                                                },
+                                                then: '1',
+                                                else : '2',
+
+                                            }
+                                        },
+
+                                    },
+                                    {
+                                        case: {
+                                            $eq: ['$finance_follow.orcredit', '0']
+                                        },
+                                        then: {
+                                            $cond: {
+                                                if : {
+                                                    $gt: [{ $subtract: [ '$current_time', {$toDouble: "$finance_follow.meta.createdAt"} ] }, 604800000]
+                                                },
+                                                then: '1',
+                                                else : '2',
+
+                                            }
+                                        },
+
+                                    },
+                                    {
+                                        case: {
+                                            $eq: ['$finance_follow.orcredit', '2']
+                                        },
+                                        then: {
+                                            $cond: {
+                                                if : {
+                                                    $gt: [{ $subtract: [ '$current_time', {$toDouble: '$finance_follow.credit_time'} ] }, 604800000]
+                                                },
+                                                then: '1',
+                                                else : '2',
+
+                                            }
+                                        },
+
+                                    },
+                                ],
+                                default: "2"
+                            }
+                    },
+
+                }
+            },
             {
                 $match: match,
 
@@ -617,6 +786,175 @@ class TUrgeHandleService extends CrudService {
 
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "t_finance_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [   {
+                                                        $eq: ['$finceType', "0"]
+                                                    },
+                                                        {
+                                                            $eq: ['$finceId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "t_finance_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    use: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    project_status: 1,
+                    remarks: 1,
+                    cdata: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    finance_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$t_finance_follows"
+                                }, 0]
+                            },
+                            then: {
+                                orcredit: "9",
+                                credit_time: {
+                                    $toDouble: "$meta.createdAt"
+                                }
+                            },
+                            else : {
+                                $arrayElemAt: ["$t_finance_follows", 0]
+                            },
+
+                        }
+                    },
+                    demand_time: {
+                        $toDouble: "$meta.createdAt"
+                    },
+
+                }
+            },
+            {
+                $addFields: {
+                    current_time: Date.now(),
+
+                }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    use: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    project_status: 1,
+                    remarks: 1,
+                    cdata: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    finance_follow: 1,
+                    demand_time: 1,
+                    current_time: 1,
+                    next_is_timeout: {
+                        $switch:
+                            {
+                                branches: [
+                                    {
+                                        case: {
+                                            $eq: ['$finance_follow.orcredit', '9']
+                                        },
+                                        then: {
+                                            $cond: {
+                                                if : {
+                                                    $gt: [{ $subtract: [ '$current_time', '$finance_follow.credit_time' ] }, 86400000]
+                                                },
+                                                then: '1',
+                                                else : '2',
+
+                                            }
+                                        },
+
+                                    },
+                                    {
+                                        case: {
+                                            $eq: ['$finance_follow.orcredit', '0']
+                                        },
+                                        then: {
+                                            $cond: {
+                                                if : {
+                                                    $gt: [{ $subtract: [ '$current_time', {$toDouble: "$finance_follow.meta.createdAt"} ] }, 604800000]
+                                                },
+                                                then: '1',
+                                                else : '2',
+
+                                            }
+                                        },
+
+                                    },
+                                    {
+                                        case: {
+                                            $eq: ['$finance_follow.orcredit', '2']
+                                        },
+                                        then: {
+                                            $cond: {
+                                                if : {
+                                                    $gt: [{ $subtract: [ '$current_time', {$toDouble: '$finance_follow.credit_time'} ] }, 604800000]
+                                                },
+                                                then: '1',
+                                                else : '2',
+
+                                            }
+                                        },
+
+                                    },
+                                ],
+                                default: "2"
+                            }
+                    },
+
+                }
+            },
             {
                 $match: match,
 
@@ -945,6 +1283,100 @@ class TUrgeHandleService extends CrudService {
                     when: 1,
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "intelligent_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [
+                                                        {
+                                                            $eq: ['$intelligentId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "intelligent_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    intelligent_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$intelligent_follows"
+                                }, 0]
+                            },
+                            then: {creditStatus:"9"},
+                            else : { $arrayElemAt: [ "$intelligent_follows", 0 ] },
+                        }
+                    },
+                }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    finance_follow: {orcredit:"$intelligent_follow.creditStatus"},
+                }
+            },
             {
                 $match: match,
 
@@ -1219,6 +1651,100 @@ class TUrgeHandleService extends CrudService {
                     when: 1,
                 }
             },
+            {
+                $lookup:
+                    {
+                        from: "intelligent_follow",
+                        let: {
+                            demand_id: "$demand_id"
+                        },
+                        pipeline: [
+                            {
+                                $match:
+                                    {
+                                        $expr:
+                                            {
+                                                $and:
+                                                    [
+                                                        {
+                                                            $eq: ['$intelligentId', "$$demand_id"]
+                                                        },
+
+                                                    ]
+                                            }
+                                    }
+                            },
+
+                        ],
+                        as: "intelligent_follows"
+                    }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    intelligent_follow: {
+                        $cond: {
+                            if : {
+                                $eq: [{
+                                    $size: "$intelligent_follows"
+                                }, 0]
+                            },
+                            then: {creditStatus:"9"},
+                            else : { $arrayElemAt: [ "$intelligent_follows", 0 ] },
+                        }
+                    },
+                }
+            },
+            {
+                $project: {
+                    jg_id: 1,
+                    jg_pro_id: 1,
+                    userid: 1,
+                    money: 1,
+                    mongey_min_rate: 1,
+                    mongey_max_rate: 1,
+                    claims_min_term: 1,
+                    claims_max_term: 1,
+                    remarks: 1,
+                    ensure_id: 1,
+                    ensure_name: 1,
+                    demand_id: 1,
+                    company_name: 1,
+                    institution_name: 1,
+                    product_name: 1,
+                    is_exist: 1,
+                    information: 1,
+                    meta: 1,
+                    person: 1,
+                    phone: 1,
+                    opening_bank: 1,
+                    orientation: 1,
+                    when: 1,
+                    finance_follow: {orcredit:"$intelligent_follow.creditStatus"},
+                }
+            },
             {
                 $match: match,