Просмотр исходного кода

金茂报表推送

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 4 лет назад
Родитель
Сommit
b29333e219
46 измененных файлов с 45 добавлено и 207 удалено
  1. 21 2
      apscheduler_elab.py
  2. 0 12
      blue/my_blue_print.py
  3. 0 11
      blue/online_blue.py
  4. 6 6
      report_push.py
  5. BIN
      static/img/apple-icon.png
  6. BIN
      static/img/avatar.jpg
  7. BIN
      static/img/bg1.jpg
  8. BIN
      static/img/bg11.jpg
  9. BIN
      static/img/bg3.jpg
  10. BIN
      static/img/bg4.jpg
  11. BIN
      static/img/bg5.jpg
  12. BIN
      static/img/bg6.jpg
  13. BIN
      static/img/bg7.jpg
  14. BIN
      static/img/bg8.jpg
  15. BIN
      static/img/blurred-image-1.jpg
  16. BIN
      static/img/creative-tim-white-slim2.png
  17. BIN
      static/img/default-avatar.png
  18. BIN
      static/img/eva.jpg
  19. BIN
      static/img/favicon.png
  20. BIN
      static/img/flags/SN.png
  21. BIN
      static/img/flags/SO.png
  22. BIN
      static/img/flags/SV.png
  23. BIN
      static/img/flags/TD.png
  24. BIN
      static/img/flags/TJ.png
  25. BIN
      static/img/flags/TL.png
  26. BIN
      static/img/flags/TR.png
  27. BIN
      static/img/flags/TZ.png
  28. BIN
      static/img/flags/UA.png
  29. BIN
      static/img/flags/US.png
  30. BIN
      static/img/flags/VE.png
  31. BIN
      static/img/flags/VN.png
  32. BIN
      static/img/flags/YE.png
  33. BIN
      static/img/header.jpg
  34. BIN
      static/img/hero-image-1.png
  35. BIN
      static/img/hero-image-2.png
  36. BIN
      static/img/hero-image-3.png
  37. BIN
      static/img/invision-white-slim.png
  38. BIN
      static/img/landing.jpg
  39. BIN
      static/img/login.jpg
  40. BIN
      static/img/logo-square.jpg
  41. BIN
      static/img/logo.png
  42. BIN
      static/img/now-logo.png
  43. 18 0
      static/img/nucleo-logo.svg
  44. BIN
      static/img/profile.jpg
  45. BIN
      static/img/ryan.jpg
  46. 0 176
      templates/form.html

+ 21 - 2
apscheduler_elab.py

@@ -18,6 +18,10 @@ class Config(object):
     jianye_brand_hour = 6
     jianye_brand_minute = 30
 
+    # SECRET_KEY = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
+
+    JSON_AS_ASCII = False
+
     JOBS = [
         {
             'id': 'day_push',
@@ -37,6 +41,15 @@ class Config(object):
             'hour': 9,
             'minute': 50
         },
+        {
+               'id': 'week_push_am_9',
+               'func': 'apscheduler_elab:Funcs.week_push_am_9',
+               'args': '',
+               'trigger': 'cron',
+               'day_of_week': 'mon',
+               'hour': 8,
+               'minute': 50
+        },
         {
             'id': 'week_push_two',
             'func': 'apscheduler_elab:Funcs.week_push_two',
@@ -165,6 +178,11 @@ class Funcs(object):
         rp = ReportPush('bi_report')
         rp.report_push(2)
 
+    @staticmethod
+    def week_push_am_9():
+        rp = ReportPush('bi_report')
+        rp.report_push(21)
+
     @staticmethod
     def week_push_two():
         rp = ReportPush('bi_report')
@@ -178,8 +196,9 @@ class Funcs(object):
 
     @staticmethod
     def day_work_three():
-        rp = ReportPush('bi_report')
-        rp.report_push_test(4)
+        # rp = ReportPush('bi_report')
+        # rp.report_push_test(4)
+        pass
 
     @staticmethod
     def day_work_5():

+ 0 - 12
blue/my_blue_print.py

@@ -1,12 +0,0 @@
-from flask import Blueprint
-
-my_blue_print = Blueprint('my_blue_print',
-                          __name__,
-                          template_folder='templates'
-                          )
-
-
-@my_blue_print.route('/test')
-def test():
-    print('test')
-    print((1/0))

+ 0 - 11
blue/online_blue.py

@@ -1,11 +0,0 @@
-from flask import Blueprint, jsonify
-from mysql_db import MysqlDB
-
-online_blue = Blueprint('online_blue', __name__)
-
-
-@online_blue.route('/online', methods=['POST', 'GET'])
-def online():
-    db = MysqlDB('linshi', 1)
-    result = db.select('select * from report_push_customer_info limit 10')
-    return jsonify(result)

+ 6 - 6
report_push.py

@@ -515,12 +515,12 @@ class ReportPush(object):
                 log_data = []
                 try:
                     if value[2]:
-                        # for mail in self.mails:
-                        result = email_util.send_mail_by_admin(title, content, value[1], value[2], value[3])
-                        if result:
-                            log_data = [value[0], value[1], value[2], 1, 'success!!!']
-                        else:
-                            log_data = [value[0], value[1], value[2], -1, '第二次发送失败']
+                        for mail in self.mails:
+                            result = email_util.send_mail_by_admin(title, content, mail, value[2], value[3])
+                            if result:
+                                log_data = [value[0], value[1], value[2], 1, 'success!!!']
+                            else:
+                                log_data = [value[0], value[1], value[2], -1, 'fail']
                 except Exception as e:
                     log_data = [value[0], value[1], value[2], -1, str(e)]
                     print(str(e))

BIN
static/img/apple-icon.png


BIN
static/img/avatar.jpg


BIN
static/img/bg1.jpg


BIN
static/img/bg11.jpg


BIN
static/img/bg3.jpg


BIN
static/img/bg4.jpg


BIN
static/img/bg5.jpg


BIN
static/img/bg6.jpg


BIN
static/img/bg7.jpg


BIN
static/img/bg8.jpg


BIN
static/img/blurred-image-1.jpg


BIN
static/img/creative-tim-white-slim2.png


BIN
static/img/default-avatar.png


BIN
static/img/eva.jpg


BIN
static/img/favicon.png


BIN
static/img/flags/SN.png


BIN
static/img/flags/SO.png


BIN
static/img/flags/SV.png


BIN
static/img/flags/TD.png


BIN
static/img/flags/TJ.png


BIN
static/img/flags/TL.png


BIN
static/img/flags/TR.png


BIN
static/img/flags/TZ.png


BIN
static/img/flags/UA.png


BIN
static/img/flags/US.png


BIN
static/img/flags/VE.png


BIN
static/img/flags/VN.png


BIN
static/img/flags/YE.png


BIN
static/img/header.jpg


BIN
static/img/hero-image-1.png


BIN
static/img/hero-image-2.png


BIN
static/img/hero-image-3.png


BIN
static/img/invision-white-slim.png


BIN
static/img/landing.jpg


BIN
static/img/login.jpg


BIN
static/img/logo-square.jpg


BIN
static/img/logo.png


BIN
static/img/now-logo.png


+ 18 - 0
static/img/nucleo-logo.svg

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="155px" height="77px" viewBox="62 -22 155 77" enable-background="new 62 -22 155 77" xml:space="preserve">
+<g>
+	<path fill="#E3E3E3" d="M130.8,13.1C126,8.7,121.4,4.3,117.1,0c-7-7-14-14.5-20.5-21.9H64.7c0.1,13.7,3.9,26.5,10.4,37.6
+		c-0.1,0.2-0.3,0.4-0.4,0.6C62.4,35,59.1,46.9,64.6,52.4c1.7,1.7,4.1,2.6,7.1,2.6c11.8,0,35.9-15.2,62.7-38.7
+		C133.2,15.3,132,14.2,130.8,13.1z M71.7,48.1c-0.6,0-1.7-0.1-2.2-0.6c-1.4-1.4-1.1-8.7,9.8-25.8c4.5,6.1,9.9,11.5,16,16
+		C84.5,44.6,76.2,48.1,71.7,48.1z"/>
+	<path fill="#E3E3E3" d="M203.9,15.5c6.5-11,10.3-23.8,10.4-37.5h-31.8c-6.4,7.3-13.3,14.6-20.6,21.9c-3.9,3.9-8,7.8-12.2,11.8
+		c-1.7-1.5-3.4-3-5.1-4.6c4.1-3.9,8.3-7.9,12.5-12.1c5.7-5.7,11.1-11.4,16.3-17.1h-67.7c5.5,6.1,11,11.9,16.2,17.1
+		c35.3,35.4,70.4,60,85.4,60c3,0,5.4-0.9,7.1-2.6c5.5-5.5,2.3-17.4-10.1-36.2C204.2,16,204,15.7,203.9,15.5z M209.5,47.6
+		c-0.5,0.5-1.6,0.6-2.2,0.6c-4.6,0-12.8-3.6-23.5-10.4c6.1-4.5,11.5-9.9,16-16C210.7,38.9,211,46.1,209.5,47.6z"/>
+	<path fill="#E3E3E3" d="M108.4,45.5c9.5,4.4,20,6.8,31.1,6.8s21.7-2.4,31.1-6.8C160.5,38.6,149.8,30,139.5,21
+		C129.2,30,118.5,38.6,108.4,45.5z"/>
+</g>
+</svg>

BIN
static/img/profile.jpg


BIN
static/img/ryan.jpg


+ 0 - 176
templates/form.html

@@ -1,176 +0,0 @@
-<html>
-<head>
-  <title>文件生成</title>
-   <style>
-    .header {
-      width: 100%;
-      height: 50px;
-      background: rgb(44, 58, 74);
-      font-size: 25px;
-      font-weight: 500px;
-      line-height: 50px;
-      color: #fff;
-      padding-left: 15px;
-      margin-bottom: 25px;
-    }
-
-    .message {
-      color: red;
-      padding: 20px 0px;
-    }
-
-    .form {
-      width: 500px;
-      margin: 0 auto;
-      background: #fff;
-      box-shadow: 4px 4px 40px rgba(0, 0, 0, .2);
-      border-color: rgba(0, 0, 0, .2);
-      padding: 0px 20px;
-      display: flex;
-      flex-direction: column;
-      align-items: center;
-      padding-bottom: 20px;
-    }
-
-    .title {
-      font-size: 14px;
-      color: #606266;
-      line-height: 20px;
-      box-sizing: border-box;
-      margin-right: 20px;
-    }
-
-    .file-row {
-      display: flex;
-      flex-direction: row;
-      align-items: center;
-      padding-bottom: 20px;
-      width: 100%;
-    }
-
-    .file-name {
-      font-size: 14px;
-      color: #606266;
-      line-height: 20px;
-      margin-left: 10px;
-    }
-
-    .file {
-      position: relative;
-      display: inline-block;
-      background: #409eff;
-      border: 1px solid #409eff;
-      border-radius: 4px;
-      padding: 4px 12px;
-      overflow: hidden;
-      color: #fff;
-      text-decoration: none;
-      text-indent: 0;
-      line-height: 20px;
-      font-size: 14px;
-    }
-
-    .file input {
-      position: absolute;
-      font-size: 100px;
-      right: 0;
-      top: 0;
-      opacity: 0;
-    }
-
-    .file:hover {
-      background: #409eff;
-      border-color: #409eff;
-      color: #fff;
-      text-decoration: none;
-    }
-
-    .number input {
-      -webkit-appearance: none;
-      background-color: #fff;
-      background-image: none;
-      border-radius: 4px;
-      border: 1px solid #dcdfe6;
-      box-sizing: border-box;
-      color: #606266;
-      display: inline-block;
-      font-size: inherit;
-      height: 40px;
-      line-height: 40px;
-      outline: 0;
-      padding: 0 15px;
-      transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
-      width: 100%;
-    }
-
-    .submitBtn {
-      display: inline-block;
-      line-height: 1;
-      white-space: nowrap;
-      cursor: pointer;
-      color: #fff;
-      background-color: #409eff;
-      border-color: #409eff;
-      -webkit-appearance: none;
-      text-align: center;
-      box-sizing: border-box;
-      outline: 0;
-      margin: 20px 0px;
-      transition: .1s;
-      font-weight: 500;
-      padding: 12px 20px;
-      font-size: 14px;
-      border-radius: 4px;
-    }
-  </style>
-    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
-    <script>
-    $(document).ready(function () {
-      $(".file").on("change", "input[type='file']", function () {
-        var filePath = $(this).val();
-        var arr = filePath.split('\\');
-        var fileName = arr[arr.length - 1];
-        document.getElementById('showFileName').innerHTML = fileName;
-      })
-    });
-   </script>
-</head>
-<!--<body>-->
-<!--  {% if message %}-->
-<!--  <p style="color:red">{{ message }}</p>-->
-<!--  {% endif %}-->
-<!--  <form action="/generation" method="post" enctype="multipart/form-data">-->
-<!--    <legend>Please sign in:</legend>-->
-<!--    <p><input name="dxf_file" placeholder="dxf_file" type="file"></p>-->
-<!--    <p><input name="area" placeholder="面积" type="number"></p>-->
-<!--    <p><button type="submit">提交户型轮廓文件</button></p>-->
-<!--  </form>-->
-<!--</body>-->
-
-<body style="margin: 0;padding: 0; background: #F2F6FC;">
-  <div class="header">mvp</div>
-  <form action="/excel_upload" method="post" enctype="multipart/form-data">
-  <div class="form">
-    <div class="message">
-        {% if message %}
-        {{ message }}
-        {% endif %}
-    </div>
-    <div class="file-row">
-      <div class="title">文件:</div>
-      <a href="javascript:;" class="file">选择文件
-        <input name="mvp_excel" placeholder="mvp_excel" type="file">
-      </a>
-      <div class="file-name" id="showFileName"></div>
-    </div>
-    <div class="file-row">
-      <div class="title">邮箱:</div>
-      <div class="number">
-        <input name="email" placeholder="请输入邮箱" type="number">
-      </div>
-    </div>
-    <button type="submit" class="submitBtn">确认更新</button>
-  </div>
-  </form>
-</body>
-</html>