def send_fail_message(self): # 发送消息 message = '' if self.state == 're_checking': message = u"风控已审批 拒绝!" elif self.state == 'auditing': message = u"主管已审批 退回!" elif self.state == 'entering': message = u"驻行录入 退回!" else: return False # 组装消息内容 ctuple = ( self._description, self.borrower_id.name, # self.tag_ids[0].name, # self.identity, # self.address, message, # fields.datetime.strftime(fields.datetime.utcnow(), u'%Y-%m-%d %H:%M:%S') fields.datetime.strftime(fields.datetime.utcnow() + datetime.timedelta(hours=8), u'%Y-%m-%d %H:%M:%S') ) content = u'【%s】 客户姓名:%s,%s。 %s' % ctuple # content = u'【%s】 客户姓名:%s,电话:%s,身份证号:%s,家庭住址:%s,%s %s' % ctuple dingtalk.send_dingtalk_message(self, content)
def send_refuse_message(self): # 发送消息 message = '' if self.state == 'auditing': message = u"风控已审批 退回!" elif self.state == 'homing': message = u"家访 退回!" elif self.state == 'phoning': message = u"电审 退回!" else: return False # 组装消息内容 ctuple = ( self._description, self.credit_id.borrower_id.name, # self.tag_ids[0].name, # self.identity, # self.address, message, fields.datetime.strftime( fields.datetime.utcnow() + datetime.timedelta(hours=8), u'%Y-%m-%d %H:%M:%S'), ) content = u'【%s】 客户姓名:%s,%s。 %s' % ctuple # content = u'【%s】 客户姓名:%s,电话:%s,身份证号:%s,家庭住址:%s,%s %s' % ctuple dingtalk.send_dingtalk_message(self, content)
def send_refuse_message(self): # 发送消息 message = '' if self.state == 'file_check': message = u"资料已审核 退回" elif self.state == 'auditing': message = u"总经理已审批 退回" elif self.state == 'remiting': message = u"财务 退回" else: return False # 组装消息内容 ctuple = ( self._description, self.loan_id.credit_id.borrower_id.name, # self.identity, # self.address, message, fields.datetime.strftime( fields.datetime.utcnow() + datetime.timedelta(hours=8), u'%Y-%m-%d %H:%M:%S'), ) content = u'【%s】 客户姓名:%s,%s。 %s' % ctuple # content = u'【%s】 客户姓名:%s,电话:%s,身份证号:%s,家庭住址:%s,%s %s' % ctuple dingtalk.send_dingtalk_message(self, content)
def send_jfzg_message(self): # 组装消息内容 if self.state == 'draft': message = u"客户经理已提交业务单,请家访主管分派调查员" else: message = u"业务单已被打回,请家访主管重新分派调查员" ctuple = ( self._description, self.credit_id.borrower_id.name, message, fields.datetime.strftime( fields.datetime.utcnow() + datetime.timedelta(hours=8), u'%Y-%m-%d %H:%M:%S'), ) content = u'【%s】 客户姓名:%s,%s %s' % ctuple print content dingtalk.send_dingtalk_message(self, content, 'jfzg')
def send_jfzy_message(self, old_homing_id=None): # 组装消息内容 message1 = '' res_old = '' if old_homing_id: message1 = u"家访主管已撤销分配给你的任务,请知晓" ctuple = ( self._description, self.credit_id.borrower_id.name, message1, fields.datetime.strftime( fields.datetime.utcnow() + datetime.timedelta(hours=8), u'%Y-%m-%d %H:%M:%S'), ) content = u'【%s】 客户姓名:%s,%s %s' % ctuple res_old = dingtalk.send_dingtalk_message(self, content, 'jfzy', old_homing_id) if res_old and res_old['errcode'] == 0: self.env.user.notify_info('已通知前调查员任务取消') message = u"家访主管已分派调查任务,请尽快处理" ctuple = ( self._description, self.credit_id.borrower_id.name, message, fields.datetime.strftime( fields.datetime.utcnow() + datetime.timedelta(hours=8), u'%Y-%m-%d %H:%M:%S'), ) content = u'【%s】 客户姓名:%s,%s %s' % ctuple print content res = dingtalk.send_dingtalk_message(self, content, 'jfzy') print 'res: %s' % (res) if res and res['errcode'] == 0: self.env.user.notify_info('分派任务消息已发送至 %s' % (self.homing_id.name)) else: self.env.user.notify_warning('分派通知消息发送失败,请自行通知调查员,并联系管理员反馈问题')