浏览代码

Merge remote-tracking branch 'origin/master' into debug

# Conflicts:
#	models/db.go
#	services/task.go
Roc 3 年之前
父节点
当前提交
14b04c77d8
共有 83 个文件被更改,包括 898 次插入219 次删除
  1. 5 4
      .gitignore
  2. 21 0
      go.mod
  3. 313 0
      go.sum
  4. 1 1
      models/admin.go
  5. 2 2
      models/classify.go
  6. 1 1
      models/company.go
  7. 1 1
      models/company/company.go
  8. 1 1
      models/company_approval.go
  9. 1 1
      models/company_approval/company_approval.go
  10. 1 1
      models/company_contract/company_contract.go
  11. 1 1
      models/company_end_date.go
  12. 1 1
      models/company_permission_log.go
  13. 1 1
      models/company_product.go
  14. 1 1
      models/company_report_permission.go
  15. 1 1
      models/company_report_permission_log.go
  16. 2 2
      models/data_entry.go
  17. 1 1
      models/data_manage/base_from_smm.go
  18. 1 1
      models/data_manage/chart_info.go
  19. 1 1
      models/data_manage/edb_data_base.go
  20. 1 1
      models/data_manage/edb_data_calculate.go
  21. 1 1
      models/data_manage/edb_data_calculate_ljztbpj.go
  22. 13 12
      models/data_manage/edb_data_calculate_time_shift.go
  23. 1 1
      models/data_manage/edb_data_calculate_zjpj.go
  24. 1 1
      models/data_manage/edb_data_cffex.go
  25. 1 1
      models/data_manage/edb_data_dl.go
  26. 1 1
      models/data_manage/edb_data_gl.go
  27. 178 0
      models/data_manage/edb_data_lt.go
  28. 1 1
      models/data_manage/edb_data_lz.go
  29. 51 28
      models/data_manage/edb_data_manual.go
  30. 1 1
      models/data_manage/edb_data_pb.go
  31. 1 1
      models/data_manage/edb_data_quarter.go
  32. 1 1
      models/data_manage/edb_data_sh.go
  33. 1 1
      models/data_manage/edb_data_shfe.go
  34. 1 1
      models/data_manage/edb_data_ths.go
  35. 1 1
      models/data_manage/edb_data_wind.go
  36. 1 1
      models/data_manage/edb_data_ys.go
  37. 1 1
      models/data_manage/edb_data_zz.go
  38. 15 3
      models/data_manage/edb_info.go
  39. 2 2
      models/data_manage/edb_info_calculate_bp.go
  40. 11 11
      models/data_manage/edb_info_calculate_hbz.go
  41. 3 3
      models/data_manage/edb_info_calculate_hcz.go
  42. 2 2
      models/data_manage/edb_info_calculate_ljztbpj.go
  43. 4 4
      models/data_manage/edb_info_calculate_ljzzy.go
  44. 2 2
      models/data_manage/edb_info_calculate_mapping.go
  45. 2 2
      models/data_manage/edb_info_calculate_nszydpjjs.go
  46. 2 2
      models/data_manage/edb_info_calculate_tbz.go
  47. 2 2
      models/data_manage/edb_info_calculate_tcz.go
  48. 2 2
      models/data_manage/edb_info_calculate_zjpj.go
  49. 1 1
      models/data_source_longzhong.go
  50. 8 8
      models/db.go
  51. 1 1
      models/edbdata.go
  52. 1 1
      models/edbdata_classify.go
  53. 1 1
      models/edbinfo_longzhong.go
  54. 1 1
      models/edbinfo_send_msg_record.go
  55. 1 1
      models/free_viewer.go
  56. 1 1
      models/longzhong.go
  57. 1 1
      models/report.go
  58. 1 1
      models/report_send_ths_detail.go
  59. 1 1
      models/report_view.go
  60. 1 1
      models/stack_company_statistic.go
  61. 1 1
      models/user_view_statistics.go
  62. 1 1
      models/users.go
  63. 2 2
      models/wechat.go
  64. 1 1
      models/wx_template_msg.go
  65. 1 1
      models/yb/activity.go
  66. 1 1
      models/yb/activity_register.go
  67. 1 1
      models/yb/activity_remind.go
  68. 1 1
      models/yb/activity_type.go
  69. 1 1
      models/yb/activity_voice.go
  70. 1 1
      models/yb/yb_speaker.go
  71. 0 4
      services/activity.go
  72. 1 1
      services/data/data_calculate.go
  73. 1 1
      services/data/data_pb.go
  74. 1 1
      services/data/data_ths.go
  75. 1 1
      services/data/data_wind.go
  76. 105 34
      services/data/edb_info.go
  77. 3 1
      services/data/edb_info_sync.go
  78. 1 1
      services/data_source_longzhong.go
  79. 24 4
      services/report_push.go
  80. 39 26
      services/task.go
  81. 11 0
      utils/common.go
  82. 17 2
      utils/config.go
  83. 3 1
      utils/constants.go

+ 5 - 4
.gitignore

@@ -4,11 +4,12 @@
 /binlog
 /rdlucklog
 /*.xlsx
-/go.sum
-/go.mod
 /hongze_task
 hongze_task
-go.sum
-go.mod
 /lastupdate.tmp
 .DS_Store
+/hongze_task.tar.gz
+/index.html
+/README.en.md
+/README.md
+/hongze_task.exe~

+ 21 - 0
go.mod

@@ -0,0 +1,21 @@
+module hongze/hongze_task
+
+go 1.16
+
+require (
+	github.com/PuerkitoBio/goquery v1.8.0
+	github.com/aliyun/aliyun-oss-go-sdk v2.2.0+incompatible
+	github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211218165449-dd623ecc2f02 // indirect
+	github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
+	github.com/beego/beego/v2 v2.0.1
+	github.com/dgrijalva/jwt-go v3.2.0+incompatible
+	github.com/go-sql-driver/mysql v1.6.0
+	github.com/rdlucklib/rdluck_tools v1.0.2
+	github.com/satori/go.uuid v1.2.0 // indirect
+	github.com/shopspring/decimal v1.3.1
+	github.com/tealeg/xlsx v1.0.5
+	github.com/wenzhenxi/gorsa v0.0.0-20210524035706-528c7050d703
+	github.com/yidane/formula v0.0.0-20210902154546-0782e1736717
+	golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
+	gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
+)

+ 313 - 0
go.sum

@@ -0,0 +1,313 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
+github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
+github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alicebob/gopher-json v0.0.0-20180125190556-5a6b3ba71ee6/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
+github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
+github.com/aliyun/aliyun-oss-go-sdk v2.2.0+incompatible h1:ht2+VfbXtNLGhCsnTMc6/N26nSTBK6qdhktjYyjJQkk=
+github.com/aliyun/aliyun-oss-go-sdk v2.2.0+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
+github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
+github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
+github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211218165449-dd623ecc2f02 h1:o2oaBQGTzO+xNh12e7xWkphNe7H2DTiWv1ml9a2P9PQ=
+github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20211218165449-dd623ecc2f02/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
+github.com/astaxie/beego v1.12.3 h1:SAQkdD2ePye+v8Gn1r4X6IKZM1wd28EyUOVQ3PDSOOQ=
+github.com/astaxie/beego v1.12.3/go.mod h1:p3qIm0Ryx7zeBHLljmd7omloyca1s4yu1a8kM1FkpIA=
+github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
+github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
+github.com/beego/beego/v2 v2.0.1 h1:07a7Z0Ok5vbqyqh+q53sDPl9LdhKh0ZDy3gbyGrhFnE=
+github.com/beego/beego/v2 v2.0.1/go.mod h1:8zyHi1FnWO1mZLwTn62aKRIZF/aIKvkCBB2JYs+eqQI=
+github.com/beego/goyaml2 v0.0.0-20130207012346-5545475820dd/go.mod h1:1b+Y/CofkYwXMUU0OhQqGvsY2Bvgr4j6jfT699wyZKQ=
+github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542/go.mod h1:kSeGC/p1AbBiEp5kat81+DSQrZenVBZXklMLaELspWU=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
+github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
+github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60=
+github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
+github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
+github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
+github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
+github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
+github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
+github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
+github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
+github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
+github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/garyburd/redigo v1.6.3/go.mod h1:rTb6epsqigu3kYKBnaF028A7Tf/Aw5s0cqA47doKKqw=
+github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
+github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
+github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
+github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
+github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
+github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
+github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
+github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
+github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
+github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
+github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
+github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
+github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
+github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
+github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
+github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
+github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
+github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
+github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
+github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/rdlucklib/rdluck_tools v1.0.2 h1:Xf1khfttpAh4D1jtMVE5OxLXhFUaDnvG74vZH7FSZQY=
+github.com/rdlucklib/rdluck_tools v1.0.2/go.mod h1:9Onw9o4w19C8KE5lxb8GyxgRBbZweRVkQSc79v38EaA=
+github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
+github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
+github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
+github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
+github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
+github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
+github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
+github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
+github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
+github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
+github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE=
+github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCnORM=
+github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
+github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
+github.com/wenzhenxi/gorsa v0.0.0-20210524035706-528c7050d703 h1:Tiqr9EWpYopXZf668mgTNWguzE6ssRIEviULO3gSWnU=
+github.com/wenzhenxi/gorsa v0.0.0-20210524035706-528c7050d703/go.mod h1:nfhBTKji6rC8lrjyikx8NJ85JHg6ZQam0a9Je+2RVOg=
+github.com/yidane/formula v0.0.0-20210902154546-0782e1736717 h1:9CTJJpdISGxMAELfVlprj5kZEsJEaNAWiobv8ZAd72U=
+github.com/yidane/formula v0.0.0-20210902154546-0782e1736717/go.mod h1:9/dQiKiN04yPMdgsuFmKGuI2Hdp6OmFV9gSWS1col6g=
+github.com/ylywyn/jpush-api-go-client v0.0.0-20190906031852-8c4466c6e369/go.mod h1:Nv7wKD2/bCdKUFNKcJRa99a+1+aSLlCRJFriFYdjz/I=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
+go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
+go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
+go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
+go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
+go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
+golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M=
+golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58 h1:1Bs6RVeBFtLZ8Yi1Hk07DiOqzvwLD/4hln4iahvFlag=
+golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
+gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
+gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
+honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=

+ 1 - 1
models/admin.go

@@ -1,6 +1,6 @@
 package models
 
-import "rdluck_tools/orm"
+import "github.com/rdlucklib/rdluck_tools/orm"
 
 type Admin struct {
 	AdminId      int

+ 2 - 2
models/classify.go

@@ -1,8 +1,8 @@
 package models
 
 import (
-	"rdluck_tools/orm"
-	"rdluck_tools/paging"
+	"github.com/rdlucklib/rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
 	"time"
 )
 

+ 1 - 1
models/company.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company/company.go

@@ -4,7 +4,7 @@ import (
 	"hongze/hongze_task/models"
 	"hongze/hongze_task/models/company_contract"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company_approval.go

@@ -1,6 +1,6 @@
 package models
 
-import "rdluck_tools/orm"
+import "github.com/rdlucklib/rdluck_tools/orm"
 
 func GetCompanyApprovalCount(companyId int,productId int) (count int, err error) {
 	sql:=`SELECT COUNT(1) AS count FROM company_approval WHERE company_id = ? AND product_id = ?  AND approve_status='待审批' `

+ 1 - 1
models/company_approval/company_approval.go

@@ -1,7 +1,7 @@
 package company_approval
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company_contract/company_contract.go

@@ -1,7 +1,7 @@
 package company_contract
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company_end_date.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company_permission_log.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company_product.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company_report_permission.go

@@ -2,7 +2,7 @@ package models
 
 import (
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/company_report_permission_log.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 2 - 2
models/data_entry.go

@@ -1,6 +1,6 @@
 package models
 
-import "rdluck_tools/orm"
+import "github.com/rdlucklib/rdluck_tools/orm"
 
 //数据录入
 
@@ -40,7 +40,7 @@ func GetEdbdataCount(tradeCode, nowDate string) (count int, err error) {
 
 // GetEdbInfoByFrequencyNotDay 获取频度非日度 且 提醒时间不为空 的指标数据
 func GetEdbInfoByFrequencyNotDay() (items []*EdbInfo, err error) {
-	sql := `SELECT * FROM edbinfo WHERE frequency!="日度" AND notice_time<>''  `
+	sql := `SELECT * FROM edbinfo WHERE frequency!="日度" AND notice_time<>'' and user_id>0 `
 	o := orm.NewOrm()
 	o.Using("edb")
 	_, err = o.Raw(sql).QueryRows(&items)

+ 1 - 1
models/data_manage/base_from_smm.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/data_manage/chart_info.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/data_manage/edb_data_base.go

@@ -4,7 +4,7 @@ import (
 	"errors"
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"time"
 )

+ 1 - 1
models/data_manage/edb_data_calculate.go

@@ -2,7 +2,7 @@ package data_manage
 
 import (
 	"fmt"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/data_manage/edb_data_calculate_ljztbpj.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 13 - 12
models/data_manage/edb_data_calculate_time_shift.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -139,7 +139,7 @@ func GetEdbInfoCalculateTimeShiftDetail(edbInfoId int) (item *EdbInfoCalculateTb
 }
 
 //刷新所有变频数据
-func RefreshAllCalculateTimeShift(edbInfoId, source, formulaInt, moveType int, fromEdbInfo *EdbInfo, edbCode, startDate, endDate, moveFrequency string) (err error) {
+func RefreshAllCalculateTimeShift(edbInfoId, source, formulaInt, moveType int, fromEdbInfo *EdbInfo, edbCode, moveFrequency string) (err error) {
 	o := orm.NewOrm()
 	o.Using("data")
 	o.Begin()
@@ -163,14 +163,14 @@ func RefreshAllCalculateTimeShift(edbInfoId, source, formulaInt, moveType int, f
 	condition += " AND edb_info_id=? "
 	pars = append(pars, fromEdbInfo.EdbInfoId)
 
-	if startDate != "" {
-		condition += " AND data_time>=? "
-		pars = append(pars, startDate)
-	}
-	if endDate != "" {
-		condition += " AND data_time<=? "
-		pars = append(pars, endDate)
-	}
+	//if startDate != "" {
+	//	condition += " AND data_time>=? "
+	//	pars = append(pars, startDate)
+	//}
+	//if endDate != "" {
+	//	condition += " AND data_time<=? "
+	//	pars = append(pars, endDate)
+	//}
 
 	var shiftDay int
 	switch moveFrequency {
@@ -218,7 +218,7 @@ func RefreshAllCalculateTimeShift(edbInfoId, source, formulaInt, moveType int, f
 		existDataMap[v.DataTime] = v.Value
 	}
 	fmt.Println("existDataMap:", existDataMap)
-	addSql := ` INSERT INTO edb_data_calculate_bp(edb_info_id,edb_code,data_time,value,create_time,modify_time,status,data_timestamp) values `
+	addSql := ` INSERT INTO edb_data_calculate_time_shift (edb_info_id,edb_code,data_time,value,create_time,modify_time,status,data_timestamp) values `
 	var isAdd bool
 
 	existMap := make(map[string]string)
@@ -234,7 +234,8 @@ func RefreshAllCalculateTimeShift(edbInfoId, source, formulaInt, moveType int, f
 			timestamp := newDate.UnixNano() / 1e6
 			timestampStr := fmt.Sprintf("%d", timestamp)
 			valStr := decimal.NewFromFloat(currentItem.Value).String()
-			if existVal, ok := existDataMap[currentItem.DataTime]; !ok {
+			if existVal, ok := existDataMap[newDate.Format(utils.FormatDate)]; !ok {
+				isAdd = true
 				addSql += GetAddSql(edbInfoIdStr, edbCode, newDate.Format(utils.FormatDate), timestampStr, valStr)
 			} else {
 				if existVal != valStr {

+ 1 - 1
models/data_manage/edb_data_calculate_zjpj.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/data_manage/edb_data_cffex.go

@@ -3,7 +3,7 @@ package data_manage
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"

+ 1 - 1
models/data_manage/edb_data_dl.go

@@ -3,7 +3,7 @@ package data_manage
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"

+ 1 - 1
models/data_manage/edb_data_gl.go

@@ -3,7 +3,7 @@ package data_manage
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"

+ 178 - 0
models/data_manage/edb_data_lt.go

@@ -0,0 +1,178 @@
+package data_manage
+
+import (
+	"encoding/json"
+	"fmt"
+	"github.com/rdlucklib/rdluck_tools/http"
+	"github.com/rdlucklib/rdluck_tools/orm"
+	"hongze/hongze_task/utils"
+	"reflect"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type EdbDataLt struct {
+	EdbDataId     int `orm:"column(edb_data_id);pk"`
+	EdbInfoId     int
+	EdbCode       string
+	DataTime      string
+	Value         float64
+	Status        int
+	CreateTime    time.Time
+	ModifyTime    time.Time
+	DataTimestamp int64
+}
+
+// AddEdbDataLtBySql 执行添加数据的sql
+func AddEdbDataLtBySql(sqlStr string) (err error) {
+	o := orm.NewOrm()
+	o.Using("data")
+	_, err = o.Raw(sqlStr).Exec()
+	return
+}
+
+// ModifyEdbDataLt 修改路透社数据
+func ModifyEdbDataLt(edbInfoId int64, dataTime string, value float64) (err error) {
+	o := orm.NewOrm()
+	o.Using("data")
+	sql := ` UPDATE edb_data_lt SET value=?,modify_time=NOW() WHERE edb_info_id=? AND data_time=? `
+	_, err = o.Raw(sql, value, edbInfoId, dataTime).Exec()
+	return
+}
+
+func GetEdbDataLtMaxOrMinDate(edbCode string) (min_date, max_date string, err error) {
+	o := orm.NewOrm()
+	o.Using("data")
+	sql := ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date FROM edb_data_lt WHERE edb_code=? `
+	err = o.Raw(sql, edbCode).QueryRow(&min_date, &max_date)
+	return
+}
+
+func GetEdbDataLtByCodeAndDate(edbCode string, startDate string) (count int, err error) {
+	o := orm.NewOrm()
+	o.Using("data")
+	sql := ` SELECT COUNT(1) AS count FROM edb_data_lt WHERE edb_code=? AND data_time=? `
+	err = o.Raw(sql, edbCode, startDate).QueryRow(&count)
+	return
+}
+
+func GetEdbDataLtByCode(edbCode string, size int) (items []*EdbInfoSearchData, err error) {
+	o := orm.NewOrm()
+	o.Using("data")
+	sql := ` SELECT * FROM edb_data_lt WHERE edb_code=? ORDER BY data_time DESC LIMIT ? `
+	_, err = o.Raw(sql, edbCode, size).QueryRows(&items)
+	return
+}
+
+//刷新所有数据
+func RefreshAllEdbDataByLt(edbInfoId, source int, edbCode, startDate, endDate string) (err error) {
+	// 获取路透社数据
+	ltDataList, err := QueryEdbDataByLt(edbCode, startDate, endDate)
+	if err != nil {
+		return
+	}
+
+	o := orm.NewOrm()
+	o.Using("data")
+	o.Begin()
+	defer func() {
+		if err != nil {
+			o.Rollback()
+		} else {
+			o.Commit()
+		}
+	}()
+
+	//获取指标所有数据
+	dataList := make([]*EdbDataBase, 0)
+	dataTableName := GetEdbDataTableName(source)
+	sql := `SELECT * FROM %s WHERE edb_info_id=? `
+	sql = fmt.Sprintf(sql, dataTableName)
+	_, err = o.Raw(sql, edbInfoId).QueryRows(&dataList)
+	if err != nil {
+		return err
+	}
+	dataMap := make(map[string]string)
+	for _, v := range dataList {
+		dataMap[v.DataTime] = v.Value
+	}
+	edbInfoIdStr := strconv.Itoa(edbInfoId)
+
+	addSql := ` INSERT INTO edb_data_lt(edb_info_id,edb_code,data_time,value,create_time,modify_time,status,data_timestamp) values `
+	var isAdd bool
+
+	for timestampInt, edbValue := range ltDataList {
+		dataTime := time.Unix(timestampInt/1000, 0)
+
+		//校验数据类型对不对
+		valType := reflect.TypeOf(edbValue)
+		if valType == nil {
+			continue
+		}
+		if valType.String() != "float64" {
+			continue
+		}
+		sValue := edbValue.(float64)
+
+		eDate := dataTime.Format(utils.FormatDate)
+		if err != nil {
+			return err
+		}
+
+		saveValue := utils.SubFloatToString(sValue, 30)
+		if existVal, ok := dataMap[eDate]; !ok {
+			timestamp := dataTime.UnixNano() / 1e6
+			timeStr := fmt.Sprintf("%d", timestamp)
+
+			addSql += GetAddSql(edbInfoIdStr, edbCode, eDate, timeStr, saveValue)
+			isAdd = true
+		} else {
+			if existVal != saveValue {
+				sql := ` UPDATE %s SET value=?,modify_time=NOW() WHERE edb_info_id=? AND data_time=? `
+				sql = fmt.Sprintf(sql, dataTableName)
+				_, err = o.Raw(sql, sValue, edbInfoId, eDate).Exec()
+				if err != nil {
+					return err
+				}
+			}
+		}
+	}
+	if isAdd {
+		addSql = strings.TrimRight(addSql, ",")
+		_, err = o.Raw(addSql).Exec()
+		if err != nil {
+			fmt.Println("RefreshAllEdbDataByLt add Err", err.Error())
+			return
+		}
+	}
+	return
+}
+
+type EdbDataFromLt struct {
+	Close map[int64]interface{} `json:"CLOSE"`
+}
+
+// QueryEdbDataByLt 获取路透社数据
+func QueryEdbDataByLt(edbCode, startDate, endDate string) (dataList map[int64]interface{}, err error) {
+	dataList = make(map[int64]interface{})
+
+	ltUrl := utils.Hz_Data_LT_Url + `edbInfo/ek?EdbCode=%s&StartDate=%s&EndDate=%s`
+	ltUrl = fmt.Sprintf(ltUrl, edbCode, startDate, endDate)
+	utils.FileLog.Info("ltUrl:%s", ltUrl)
+	body, err := http.Get(ltUrl)
+	utils.FileLog.Info("lt result:%s", string(body))
+
+	if err != nil {
+		return
+	}
+	//fmt.Println(string(body))
+	item := new(EdbDataFromLt)
+	err = json.Unmarshal(body, &item)
+
+	if err != nil {
+		return
+	}
+	dataList = item.Close
+	return
+}

+ 1 - 1
models/data_manage/edb_data_lz.go

@@ -3,7 +3,7 @@ package data_manage
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"

+ 51 - 28
models/data_manage/edb_data_manual.go

@@ -2,8 +2,8 @@ package data_manage
 
 import (
 	"fmt"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -27,7 +27,7 @@ func GetEdbDataManualMaxOrMinDate(edbCode string) (min_date, max_date string, er
 type ManualEdbdata struct {
 	TradeCode  string    `orm:"column(TRADE_CODE);pk" description:"指标编码"`
 	Dt         string    `orm:"column(DT)" description:"日期"`
-	Close      string    `orm:"column(CLOSE)" description:"值"`
+	Close      float64   `orm:"column(CLOSE)" description:"值"`
 	ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"`
 }
 
@@ -38,7 +38,7 @@ func GetEdbdataManualByTradeCode(condition string, pars []interface{}) (item []*
 	if condition != "" {
 		sql += condition
 	}
-	sql+=` ORDER BY DT DESC `
+	sql += ` ORDER BY DT DESC `
 	_, err = o.Raw(sql, pars).QueryRows(&item)
 	return
 }
@@ -60,7 +60,8 @@ func ModifyEdbDataManual(edbInfoId int64, dataTime, value string) (err error) {
 }
 
 //刷新手工指标数据
-func RefreshManual(edbInfoId int, edbCode, startDate, endDate string) (err error) {
+func RefreshManual(item *EdbInfoList) (err error) {
+	//edbInfoId int, edbCode, startDate, endDate string
 	o := orm.NewOrm()
 	o.Using("data")
 	o.Begin()
@@ -72,6 +73,9 @@ func RefreshManual(edbInfoId int, edbCode, startDate, endDate string) (err error
 		}
 	}()
 
+	edbInfoId := item.EdbInfoId
+	edbCode := item.EdbCode
+
 	if err != nil {
 		return
 	}
@@ -79,36 +83,40 @@ func RefreshManual(edbInfoId int, edbCode, startDate, endDate string) (err error
 	//计算数据
 	var condition string
 	var pars []interface{}
-
 	if edbCode != "" {
 		condition += " AND TRADE_CODE=? "
 		pars = append(pars, edbCode)
 	}
 
-	if startDate != "" {
-		condition += " AND DT>=? "
-		pars = append(pars, startDate)
-	}
+	//获取已存在的手工数据
+	manualDataList, err := GetEdbdataManualByTradeCode(condition, pars)
 
-	if endDate != "" {
-		condition += " AND DT<=? "
-		pars = append(pars, endDate)
+	var existCondition string
+	var existPars []interface{}
+	if edbCode != "" {
+		existCondition += " AND edb_code=? "
+		existPars = append(existPars, edbCode)
+	}
+	//获取ETA指标库已存在的所有数据
+	existDataList, err := GetEdbDataListAll(existCondition, existPars, utils.DATA_SOURCE_MANUAL, 0)
+	if err != nil {
+		return err
 	}
 
-	manualDataList, err := GetEdbdataManualByTradeCode(condition, pars)
+	existMap := make(map[string]*EdbInfoSearchData)
+	for _, v := range existDataList {
+		existMap[v.DataTime] = v
+	}
 
 	addSql := ` INSERT INTO edb_data_manual(edb_info_id,edb_code,data_time,value,create_time,modify_time,status,data_timestamp) values `
 	var isAdd bool
+	manualMap := make(map[string]*ManualEdbdata)
 	for _, v := range manualDataList {
 		item := v
-		count, err := GetEdbDataManualByCodeAndDate(v.TradeCode, v.Dt)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			return err
-		}
-		if count <= 0 {
+		eDate := item.Dt
+		sValue := utils.SubFloatToString(item.Close, 4)
+		if findItem, ok := existMap[v.Dt]; !ok {
 			nowStr := time.Now().Format(utils.FormatDateTime)
-			eDate := item.Dt
-			sValue := item.Close
 			dataTime, err := time.Parse(utils.FormatDate, eDate)
 			if err != nil {
 				return err
@@ -121,12 +129,22 @@ func RefreshManual(edbInfoId int, edbCode, startDate, endDate string) (err error
 			addSql += "),"
 			isAdd = true
 		} else {
-			err = ModifyEdbDataManual(int64(edbInfoId), v.Dt, v.Close)
-			if err != nil {
-				return err
+			if item.Close != findItem.Value {
+				err = ModifyEdbDataManual(int64(edbInfoId), eDate, sValue)
+				if err != nil {
+					return err
+				}
 			}
 		}
+		manualMap[v.Dt] = v
+	}
+
+	for _, v := range existDataList {
+		if _, ok := manualMap[v.DataTime]; !ok {
+			go DeleteEdbDataByIdAndSource(v.EdbDataId, utils.DATA_SOURCE_MANUAL)
+		}
 	}
+
 	if isAdd {
 		addSql = strings.TrimRight(addSql, ",")
 		_, err = o.Raw(addSql).Exec()
@@ -137,13 +155,18 @@ func RefreshManual(edbInfoId int, edbCode, startDate, endDate string) (err error
 
 	maxAndMinItem, err := GetEdbInfoMaxAndMinInfo(utils.DATA_SOURCE_MANUAL, edbCode)
 	if err != nil {
-		return err
-	}
-	if maxAndMinItem != nil {
-		err = ModifyEdbInfoMaxAndMinInfo(edbInfoId, maxAndMinItem)
-		if err != nil {
+		if err.Error() == utils.ErrNoRow() {
+			err = nil
+		} else {
 			return err
 		}
+	} else {
+		if maxAndMinItem != nil {
+			err = ModifyEdbInfoMaxAndMinInfo(edbInfoId, maxAndMinItem)
+			if err != nil {
+				return err
+			}
+		}
 	}
 	return
 }

+ 1 - 1
models/data_manage/edb_data_pb.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/data_manage/edb_data_quarter.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 )
 
 func GetEdbDataQuarterCount(edbInfoId int) (count int, err error) {

+ 1 - 1
models/data_manage/edb_data_sh.go

@@ -3,7 +3,7 @@ package data_manage
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"

+ 1 - 1
models/data_manage/edb_data_shfe.go

@@ -3,7 +3,7 @@ package data_manage
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"

+ 1 - 1
models/data_manage/edb_data_ths.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/data_manage/edb_data_wind.go

@@ -1,7 +1,7 @@
 package data_manage
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/data_manage/edb_data_ys.go

@@ -15,7 +15,7 @@ import (
 	"io/ioutil"
 	"net/http"
 	"net/url"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"time"
 )

+ 1 - 1
models/data_manage/edb_data_zz.go

@@ -3,7 +3,7 @@ package data_manage
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"

+ 15 - 3
models/data_manage/edb_info.go

@@ -2,7 +2,7 @@ package data_manage
 
 import (
 	"fmt"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 
@@ -45,8 +45,9 @@ type EdbInfoList struct {
 }
 
 type EdbInfoSearchData struct {
-	DataTime string  `description:"数据日期"`
-	Value    float64 `description:"数据"`
+	EdbDataId int     `description:"指标数据Id"`
+	DataTime  string  `description:"数据日期"`
+	Value     float64 `description:"数据"`
 }
 
 type EdbInfoSearchDataV1 struct {
@@ -199,3 +200,14 @@ func GetEdbInfoCalculateListByCondition(condition string, pars []interface{}) (i
 	_, err = o.Raw(sql, pars).QueryRows(&items)
 	return
 }
+
+func DeleteEdbDataByIdAndSource(edbDataId, source int) (err error) {
+	sql := ` DELETE FROM %s WHERE edb_data_id=? `
+	tableName := GetEdbDataTableName(source)
+	sql = fmt.Sprintf(sql, tableName)
+
+	o := orm.NewOrm()
+	o.Using("data")
+	_, err = o.Raw(sql, edbDataId).Exec()
+	return
+}

+ 2 - 2
models/data_manage/edb_info_calculate_bp.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -158,7 +158,7 @@ func GetEdbInfoCalculateBpDetail(edbInfoId int) (item *EdbInfoCalculateTbzDetail
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return

+ 11 - 11
models/data_manage/edb_info_calculate_hbz.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -38,7 +38,7 @@ func HbzDiv(current, pre float64) string {
 }
 
 //刷新环比值数据
-func RefreshCalculateHbz(edbInfoId, source int, fromEdbInfo *EdbInfo, edbCode string, formulaInt int) (err error) {
+func RefreshCalculateHbz(edbInfoId, source int, fromEdbInfo *EdbInfo, edbCode, startDate, endDate string, formulaInt int) (err error) {
 	o := orm.NewOrm()
 	o.Using("data")
 	o.Begin()
@@ -60,14 +60,14 @@ func RefreshCalculateHbz(edbInfoId, source int, fromEdbInfo *EdbInfo, edbCode st
 	condition += " AND edb_info_id=? "
 	pars = append(pars, fromEdbInfo.EdbInfoId)
 
-	//if startDate != "" {
-	//	condition += " AND data_time>=? "
-	//	pars = append(pars, startDate)
-	//}
-	//if endDate != "" {
-	//	condition += " AND data_time<=? "
-	//	pars = append(pars, endDate)
-	//}
+	if startDate != "" {
+		condition += " AND data_time>=? "
+		pars = append(pars, startDate)
+	}
+	if endDate != "" {
+		condition += " AND data_time<=? "
+		pars = append(pars, endDate)
+	}
 
 	dataList, err := GetEdbDataListAll(condition, pars, fromEdbInfo.Source, 0)
 	if err != nil {
@@ -157,7 +157,7 @@ func GetEdbInfoCalculateHbzDetail(edbInfoId int) (item *EdbInfoCalculateTbzDetai
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return

+ 3 - 3
models/data_manage/edb_info_calculate_hcz.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -156,8 +156,8 @@ func GetEdbInfoCalculateHczDetail(edbInfoId int) (item *EdbInfoCalculateHczDetai
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return
-}
+}

+ 2 - 2
models/data_manage/edb_info_calculate_ljztbpj.go

@@ -5,7 +5,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"sort"
 	"strings"
 	"time"
@@ -29,7 +29,7 @@ type EdbInfoCalculateLjztbpjDetail struct {
 }
 
 // RefreshAllCalculateLjztbpj 刷新所有 累计值同比拼接 数据
-func RefreshAllCalculateLjztbpj(edbInfo *EdbInfoList) (err error) {
+func RefreshAllCalculateLjztbpj(edbInfo *EdbInfo) (err error) {
 	o := orm.NewOrm()
 	o.Using("data")
 	o.Begin()

+ 4 - 4
models/data_manage/edb_info_calculate_ljzzy.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -195,7 +195,7 @@ func GetEdbInfoCalculateLjzzyDetail(edbInfoId int) (item *EdbInfoCalculateLjzzyD
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return
@@ -209,10 +209,10 @@ func GetEdbDataCalculateLjzzyByCodeAndDate(edbCode string, startDate string) (co
 	return
 }
 
-func ModifyEdbDataCalculateLjzzy(edbInfoId int64, dataTime,value string) (err error) {
+func ModifyEdbDataCalculateLjzzy(edbInfoId int64, dataTime, value string) (err error) {
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` UPDATE edb_data_calculate_ljzzy SET value=?,modify_time=NOW() WHERE edb_info_id=? AND data_time=? `
 	_, err = o.Raw(sql, value, edbInfoId, dataTime).Exec()
 	return
-}
+}

+ 2 - 2
models/data_manage/edb_info_calculate_mapping.go

@@ -2,7 +2,7 @@ package data_manage
 
 import (
 	"fmt"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 
@@ -107,7 +107,7 @@ func GetEdbInfoCalculateMappingDetail(edbInfoId int) (item *EdbInfoCalculateMapp
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date,b.calculate_formula,b.move_type,b.move_frequency FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return

+ 2 - 2
models/data_manage/edb_info_calculate_nszydpjjs.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -170,7 +170,7 @@ func GetEdbInfoCalculateNszydpjjsDetail(edbInfoId int) (item *EdbInfoCalculateNs
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return

+ 2 - 2
models/data_manage/edb_info_calculate_tbz.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -280,7 +280,7 @@ func GetEdbInfoCalculateTbzDetail(edbInfoId int) (item *EdbInfoCalculateTbzDetai
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return

+ 2 - 2
models/data_manage/edb_info_calculate_tcz.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"github.com/shopspring/decimal"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strconv"
 	"strings"
 	"time"
@@ -281,7 +281,7 @@ func GetEdbInfoCalculateTczDetail(edbInfoId int) (item *EdbInfoCalculateTczDetai
 	o := orm.NewOrm()
 	o.Using("data")
 	sql := ` SELECT a.*,b.start_date,b.end_date FROM edb_info_calculate_mapping AS a
-			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
+			INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	err = o.Raw(sql, edbInfoId).QueryRow(&item)
 	return

+ 2 - 2
models/data_manage/edb_info_calculate_zjpj.go

@@ -4,7 +4,7 @@ import (
 	"errors"
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strings"
 	"time"
 )
@@ -27,7 +27,7 @@ type EdbInfoCalculateZjpjDetail struct {
 }
 
 // RefreshAllCalculateZjpj 刷新所有 直接拼接 数据
-func RefreshAllCalculateZjpj(edbInfo *EdbInfoList) (err error) {
+func RefreshAllCalculateZjpj(edbInfo *EdbInfo) (err error) {
 	o := orm.NewOrm()
 	o.Using("data")
 	o.Begin()

+ 1 - 1
models/data_source_longzhong.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 8 - 8
models/db.go

@@ -9,7 +9,7 @@ import (
 	"hongze/hongze_task/utils"
 	"time"
 
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 )
 
 func init() {
@@ -83,15 +83,15 @@ func init() {
 		new(data_manage.EdbDataYs),
 		new(Edbdata),
 		new(data_manage.EdbInfoCalculateMapping),
-		new(yb.Activity),         // 研报活动表
-		new(yb.ActivityType),     //研报活动分类表
-		new(yb.ActivityVoice),    //研报活动语音表
-		new(yb.ActivityRegister), //研报活动报名表
-		new(yb.Speaker),          //研报主持人表
 		new(UserViewStatistics),
-		new(data_manage.EdbInfo), //hz_data库的edb_info表
-		new(data_manage.EdbInfoCalculateMapping),
+		new(data_manage.EdbInfo),                 //hz_data库的edb_info表
 		new(data_manage.EdbDataCalculateZjpj),    //直接拼接
 		new(data_manage.EdbDataCalculateLjztbpj), //累计同比值拼接
+		new(yb.Activity),                         // 研报活动表
+		new(yb.ActivityType),                     //研报活动分类表
+		new(yb.ActivityVoice),                    //研报活动语音表
+		new(yb.ActivityRegister),                 //研报活动报名表
+		new(yb.Speaker),                          //研报主持人表
+		new(data_manage.EdbDataLt),               //路透指标数据表
 	)
 }

+ 1 - 1
models/edbdata.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/edbdata_classify.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/edbinfo_longzhong.go

@@ -1,6 +1,6 @@
 package models
 
-import "rdluck_tools/orm"
+import "github.com/rdlucklib/rdluck_tools/orm"
 
 type DataSourceLongzhong struct {
 	Id int `orm:"column(id);pk"`

+ 1 - 1
models/edbinfo_send_msg_record.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/free_viewer.go

@@ -1,6 +1,6 @@
 package models
 
-import "rdluck_tools/orm"
+import "github.com/rdlucklib/rdluck_tools/orm"
 
 type FreeViewerDetails struct {
 	RealName       string

+ 1 - 1
models/longzhong.go

@@ -1,6 +1,6 @@
 package models
 
-import "rdluck_tools/orm"
+import "github.com/rdlucklib/rdluck_tools/orm"
 
 func GetLongzhonginfoByClassifyId(classifyId int) (items []*Longzhonginfo, err error) {
 	sql := `SELECT * FROM longzhonginfo WHERE classify_id=? ORDER BY longzhonginfo_id ASC `

+ 1 - 1
models/report.go

@@ -3,7 +3,7 @@ package models
 import (
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/report_send_ths_detail.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/report_view.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 )
 
 type ResearchReportViewers struct {

+ 1 - 1
models/stack_company_statistic.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/user_view_statistics.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/users.go

@@ -1,7 +1,7 @@
 package models
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strings"
 )
 

+ 2 - 2
models/wechat.go

@@ -4,8 +4,8 @@ import (
 	"encoding/json"
 	"fmt"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/http"
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/http"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"strings"
 	"time"
 )

+ 1 - 1
models/wx_template_msg.go

@@ -1,6 +1,6 @@
 package models
 
-import "rdluck_tools/orm"
+import "github.com/rdlucklib/rdluck_tools/orm"
 
 type SendTemplateResponse struct {
 	Errcode int    `json:"errcode"`

+ 1 - 1
models/yb/activity.go

@@ -1,7 +1,7 @@
 package yb
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/yb/activity_register.go

@@ -1,7 +1,7 @@
 package yb
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/yb/activity_remind.go

@@ -1,7 +1,7 @@
 package yb
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/yb/activity_type.go

@@ -1,7 +1,7 @@
 package yb
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/yb/activity_voice.go

@@ -1,7 +1,7 @@
 package yb
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 	"time"
 )
 

+ 1 - 1
models/yb/yb_speaker.go

@@ -1,7 +1,7 @@
 package yb
 
 import (
-	"rdluck_tools/orm"
+	"github.com/rdlucklib/rdluck_tools/orm"
 )
 
 // Speaker 活动表

+ 0 - 4
services/activity.go

@@ -123,10 +123,6 @@ func sendWxMsg(activityInfo *yb.Activity, remindType string) (err error) {
 	}
 	//小程序跳转地址
 	wxAppPath := `pages-activity/detail?id=` + fmt.Sprint(activityInfo.ActivityId)
-	//由于测试环境小程序没有发布,模板消息设置了小程序跳转地址,会导致模板消息发送失败
-	if utils.RunMode == `debug` {
-		wxAppPath = ``
-	}
 	err = SendWxMsgWithActivityAppointmentRemind(first, keyword1, keyword2, keyword3, keyword4, remark, wxAppPath, openidList)
 	return
 }

+ 1 - 1
services/data/data_calculate.go

@@ -69,7 +69,7 @@ func RefreshCalculate(edbInfoIdArr []*data_manage.EdbInfo, edbInfoId int, edbCod
 			expression := formula.NewExpression(formulaFormStr)
 			calResult, err := expression.Evaluate()
 			if err != nil {
-				err = errors.New("计算失败:Err:" + err.Error() + ";formulaStr:" + formulaFormStr)
+				err = errors.New("计算失败,edbCode:" + fmt.Sprint(edbCode) + ":Err:" + err.Error() + ";formulaStr:" + formulaFormStr)
 				fmt.Println(err)
 				return err
 			}

+ 1 - 1
services/data/data_pb.go

@@ -6,7 +6,7 @@ import (
 	"hongze/hongze_task/models/data_manage"
 	"hongze/hongze_task/utils"
 	"net/url"
-	"rdluck_tools/http"
+	"github.com/rdlucklib/rdluck_tools/http"
 	"strings"
 	"time"
 )

+ 1 - 1
services/data/data_ths.go

@@ -6,7 +6,7 @@ import (
 	"fmt"
 	"hongze/hongze_task/models/data_manage"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/http"
+	"github.com/rdlucklib/rdluck_tools/http"
 	"strings"
 	"time"
 )

+ 1 - 1
services/data/data_wind.go

@@ -6,7 +6,7 @@ import (
 	"fmt"
 	"hongze/hongze_task/models/data_manage"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/http"
+	"github.com/rdlucklib/rdluck_tools/http"
 	"strings"
 	"time"
 )

+ 105 - 34
services/data/edb_info.go

@@ -4,9 +4,9 @@ import (
 	"context"
 	"errors"
 	"fmt"
+	"github.com/rdlucklib/rdluck_tools/http"
 	"hongze/hongze_task/models/data_manage"
 	"hongze/hongze_task/utils"
-	"rdluck_tools/http"
 	"strconv"
 	"sync"
 	"time"
@@ -241,7 +241,7 @@ func RefreshDataFromCalculateAll() (err error) {
 	condition += " AND edb_type=? "
 	pars = append(pars, 2)
 
-	condition += " AND is_update=1 "
+	//condition += " AND is_update=1 "
 
 	items, err := data_manage.GetEdbInfoByCondition(condition, pars, 0)
 	if err != nil {
@@ -281,7 +281,7 @@ func RefreshDataFromCalculateAll() (err error) {
 				edbInfo, _ := data_manage.GetEdbInfoById(v.FromEdbInfoId)
 				edbInfoList = append(edbInfoList, edbInfo)
 			}
-			endDate = ""
+			//endDate = ""
 			err = RefreshCalculate(edbInfoList, edbInfoId, edbCode, v.CalculateFormula, startDate, endDate, edbInfoIdBytes)
 			if err != nil {
 				return errors.New("RefreshCalculate Err:" + err.Error())
@@ -289,10 +289,16 @@ func RefreshDataFromCalculateAll() (err error) {
 		} else if source == utils.DATA_SOURCE_CALCULATE_LJZZY {
 			calculateLjzzy, err := data_manage.GetEdbInfoCalculateLjzzyDetail(edbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return errors.New("GetEdbInfoCalculateLjzzyDetail Err:" + err.Error())
 			}
 			fromEdbInfo, err := data_manage.GetEdbInfoById(calculateLjzzy.FromEdbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return errors.New("GetEdbInfoById Err:" + err.Error())
 			}
 			year := time.Now().Year() - 1
@@ -309,6 +315,9 @@ func RefreshDataFromCalculateAll() (err error) {
 			}
 			fromEdbInfo, err := data_manage.GetEdbInfoById(calculateTbz.FromEdbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return errors.New("GetEdbInfoById Err:" + err.Error())
 			}
 			startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
@@ -324,6 +333,9 @@ func RefreshDataFromCalculateAll() (err error) {
 			}
 			fromEdbInfo, err := data_manage.GetEdbInfoById(calculateTcz.FromEdbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return errors.New("GetEdbInfoById Err:" + err.Error())
 			}
 			startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
@@ -339,6 +351,9 @@ func RefreshDataFromCalculateAll() (err error) {
 			}
 			fromEdbInfo, err := data_manage.GetEdbInfoById(calculateNszydpjjs.FromEdbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return errors.New("GetEdbInfoById Err:" + err.Error())
 			}
 			formulaInt, _ := strconv.Atoi(v.CalculateFormula)
@@ -353,12 +368,15 @@ func RefreshDataFromCalculateAll() (err error) {
 			}
 			fromEdbInfo, err := data_manage.GetEdbInfoById(calculateHbz.FromEdbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return errors.New("GetEdbInfoById Err:" + err.Error())
 			}
-			//startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
-			//endDate := "" //time.Now().Format(utils.FormatDate)
+			startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
+			endDate := "" //time.Now().Format(utils.FormatDate)
 			formulaInt, _ := strconv.Atoi(v.CalculateFormula)
-			err = data_manage.RefreshCalculateHbz(edbInfoId, source, fromEdbInfo, calculateHbz.EdbCode, formulaInt)
+			err = data_manage.RefreshCalculateHbz(edbInfoId, source, fromEdbInfo, calculateHbz.EdbCode, startDate, endDate, formulaInt)
 			if err != nil {
 				return errors.New("RefreshCalculateTbz Err:" + err.Error())
 			}
@@ -369,6 +387,9 @@ func RefreshDataFromCalculateAll() (err error) {
 			}
 			fromEdbInfo, err := data_manage.GetEdbInfoById(calculateHcz.FromEdbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return errors.New("GetEdbInfoById Err:" + err.Error())
 			}
 			startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
@@ -385,6 +406,9 @@ func RefreshDataFromCalculateAll() (err error) {
 			if calculateBp != nil {
 				fromEdbInfo, err := data_manage.GetEdbInfoById(calculateBp.FromEdbInfoId)
 				if err != nil {
+					if err.Error() == utils.ErrNoRow() {
+						continue
+					}
 					return errors.New("GetEdbInfoById Err:" + err.Error())
 				}
 				startDate := time.Now().AddDate(-2, -2, 0).Format(utils.FormatDate)
@@ -401,23 +425,40 @@ func RefreshDataFromCalculateAll() (err error) {
 			}
 			fromEdbInfo, err := data_manage.GetEdbInfoById(calculate.FromEdbInfoId)
 			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
 				return fmt.Errorf("GetEdbInfoById Err:" + err.Error())
 			}
-			startDate := v.StartDate.Format(utils.FormatDate)
-			endDate := time.Now().Format(utils.FormatDate)
+			//startDate := v.StartDate.Format(utils.FormatDate)
+			//endDate := time.Now().Format(utils.FormatDate)
 			formulaInt, _ := strconv.Atoi(calculate.CalculateFormula)
-			err = data_manage.RefreshAllCalculateTimeShift(edbInfoId, source, formulaInt, calculate.MoveType, fromEdbInfo, calculate.EdbCode, startDate, endDate, calculate.MoveFrequency)
+			err = data_manage.RefreshAllCalculateTimeShift(edbInfoId, source, formulaInt, calculate.MoveType, fromEdbInfo, calculate.EdbCode, calculate.MoveFrequency)
 			if err != nil {
 				return fmt.Errorf("RefreshAllCalculateTimeShift Err:" + err.Error())
 			}
 
 		} else if source == utils.DATA_SOURCE_CALCULATE_ZJPJ { //刷新直接拼接
-			err = data_manage.RefreshAllCalculateZjpj(v)
+			tmpEdbInfo, err := data_manage.GetEdbInfoById(v.EdbInfoId)
+			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
+				return fmt.Errorf("GetEdbInfoById Err:" + err.Error())
+			}
+			err = data_manage.RefreshAllCalculateZjpj(tmpEdbInfo)
 			if err != nil {
 				return fmt.Errorf("RefreshAllCalculateZjpj Err:" + err.Error())
 			}
 		} else if source == utils.DATA_SOURCE_CALCULATE_LJZTBPJ { //刷新累计值同比拼接
-			err = data_manage.RefreshAllCalculateLjztbpj(v)
+			tmpEdbInfo, err := data_manage.GetEdbInfoById(v.EdbInfoId)
+			if err != nil {
+				if err.Error() == utils.ErrNoRow() {
+					continue
+				}
+				return fmt.Errorf("GetEdbInfoById Err:" + err.Error())
+			}
+			err = data_manage.RefreshAllCalculateLjztbpj(tmpEdbInfo)
 			if err != nil {
 				return fmt.Errorf("RefreshAllCalculateLjztbpj Err:" + err.Error())
 			}
@@ -462,35 +503,24 @@ func RefreshDataFromManual(wg *sync.WaitGroup) (err error) {
 		return errors.New("GetEdbInfoByCondition:" + err.Error())
 	}
 
-	var endDate string
-	endDate = time.Now().AddDate(utils.DATA_END_DATE_LIMIT, 0, 0).Format(utils.FormatDate)
 	for _, v := range items {
-		startDate := ""
-		if v.Frequency == "日度" {
-			startDate = v.EndDate.AddDate(0, 0, -utils.DATA_REFRESH).Format(utils.FormatDate)
-		} else if v.Frequency == "周度" {
-			startDate = v.EndDate.AddDate(0, 0, -(utils.DATA_REFRESH * 7)).Format(utils.FormatDate)
-		} else if v.Frequency == "月度" {
-			startDate = v.EndDate.AddDate(0, -utils.DATA_REFRESH, 0).Format(utils.FormatDate)
-		} else if v.Frequency == "季度" {
-			startDate = v.EndDate.AddDate(0, -utils.DATA_REFRESH*3, 0).Format(utils.FormatDate)
-		} else if v.Frequency == "年度" {
-			startDate = v.EndDate.AddDate(-utils.DATA_REFRESH, 0, 0).Format(utils.FormatDate)
-		} else {
-			startDate = v.EndDate.AddDate(0, 0, -utils.DATA_REFRESH).Format(utils.FormatDate)
-		}
-		err = data_manage.RefreshManual(v.EdbInfoId, v.EdbCode, startDate, endDate)
+		err = data_manage.RefreshManual(v)
 		if err != nil {
-			return errors.New("SyncEdbDataByThs:" + err.Error())
+			return errors.New("RefreshManual:edbCode:" + v.EdbCode + ":" + err.Error())
 		}
 		item, err := data_manage.GetEdbInfoMaxAndMinInfo(v.Source, v.EdbCode)
 		if err != nil {
-			return err
-		}
-		if item != nil {
-			err = data_manage.ModifyEdbInfoMaxAndMinInfo(v.EdbInfoId, item)
-			if err != nil {
+			if err.Error() != utils.ErrNoRow() {
 				return err
+			} else {
+				err = nil
+			}
+		} else {
+			if item != nil {
+				err = data_manage.ModifyEdbInfoMaxAndMinInfo(v.EdbInfoId, item)
+				if err != nil {
+					return err
+				}
 			}
 		}
 	}
@@ -931,6 +961,47 @@ func RefreshDataFromZz(wg *sync.WaitGroup) (err error) {
 	return err
 }
 
+// RefreshDataFromLt 刷新路透数据
+func RefreshDataFromLt(wg *sync.WaitGroup) (err error) {
+	defer func() {
+		if err != nil {
+			fmt.Println("RefreshDataFromLt Err:" + err.Error())
+			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "RefreshDataFromLt ErrMsg:"+err.Error(), utils.EmailSendToUsers)
+		}
+		wg.Done()
+	}()
+	var condition string
+	var pars []interface{}
+	condition += " AND source=? "
+	pars = append(pars, utils.DATA_SOURCE_LT)
+	items, err := data_manage.GetEdbInfoByCondition(condition, pars, 0)
+	if err != nil {
+		return errors.New("GetEdbInfoByCondition:" + err.Error())
+	}
+
+	endDate := time.Now().Format(utils.FormatDate)
+	for _, v := range items {
+		startDate := v.StartDate.Format(utils.FormatDate)
+		err = data_manage.RefreshAllEdbDataByLt(v.EdbInfoId, utils.DATA_SOURCE_LT, v.EdbCode, startDate, endDate)
+		if err != nil {
+			return errors.New("RefreshEdbDataByLt:" + err.Error())
+		}
+
+		//更新指标的最新数据
+		item, err := data_manage.GetEdbInfoMaxAndMinInfo(v.Source, v.EdbCode)
+		if err != nil {
+			return err
+		}
+		if item != nil {
+			err = data_manage.ModifyEdbInfoMaxAndMinInfo(v.EdbInfoId, item)
+			if err != nil {
+				return err
+			}
+		}
+	}
+	return err
+}
+
 func ResetEdbInfoIsUpdate(cont context.Context) (err error) {
 	go data_manage.ResetEdbInfoIsUpdate()
 	return nil

+ 3 - 1
services/data/edb_info_sync.go

@@ -121,13 +121,15 @@ func SyncManualDataBase() {
 	var condition string
 	var pars []interface{}
 	condition += " AND source=? "
+	condition += " AND edb_code='W000156' "
+
 	pars = append(pars, utils.DATA_SOURCE_MANUAL)
 	items, err := data_manage.GetEdbInfoByCondition(condition, pars, 0)
 	if err != nil {
 		return
 	}
 	for _, v := range items {
-		err = data_manage.RefreshManual(v.EdbInfoId, v.EdbCode, v.StartDate.Format(utils.FormatDate), "")
+		err = data_manage.RefreshManual(v)
 		if err != nil {
 			return
 		}

+ 1 - 1
services/data_source_longzhong.go

@@ -12,7 +12,7 @@ import (
 	"net/url"
 	"os"
 	"path/filepath"
-	"rdluck_tools/http"
+	"github.com/rdlucklib/rdluck_tools/http"
 	"strconv"
 	"strings"
 	"time"

+ 24 - 4
services/report_push.go

@@ -254,21 +254,33 @@ func SendThs(title, labelStr, abstract, jumpBaseUrl, logoUrl string) (err error)
 	sendUrl := utils.THS_SendUrl
 	//fmt.Println("sendUrl:", sendUrl)
 
-	utils.FileLog.Info("title:%s", title)
+	//标题字符长度截取,最多50位字符
+	title = utils.SubStr(title, 50)
+	utils.FileLog.Info(fmt.Sprintf("title:%s", title))
 	title, err = gorsa.PublicEncrypt(title, pubKey)
-	utils.FileLog.Info("labelStr:%s", labelStr)
+	if err != nil {
+		return
+	}
+
+	//简介字符长度截取,最多50位字符
+	abstract = utils.SubStr(abstract, 50)
+	utils.FileLog.Info(fmt.Sprintf("abstract:%s", abstract))
 	abstract, err = gorsa.PublicEncrypt(abstract, pubKey)
 	if err != nil {
 		return
 	}
+
+	utils.FileLog.Info(fmt.Sprintf("labelStr:%s", labelStr))
 	label, err := gorsa.PublicEncrypt(labelStr, pubKey)
 	if err != nil {
 		return
 	}
+
 	jumpUrl, err := gorsa.PublicEncrypt(jumpBaseUrl, pubKey)
 	if err != nil {
 		return
 	}
+
 	picUrl, err := gorsa.PublicEncrypt(logoUrl, pubKey)
 	if err != nil {
 		return
@@ -331,18 +343,26 @@ func SyncWxGroup(openCompanyCode, deadline string) (err error) {
 	if err != nil {
 		return
 	}
+
 	deadline, err = gorsa.PublicEncrypt(deadline, pubKey)
 	if err != nil {
 		return
 	}
 
+	status := `1`
+	status, err = gorsa.PublicEncrypt(status, pubKey)
+	if err != nil {
+		return
+	}
+
 	//开始发送
 	client := http.Client{}
 	form := url.Values{}
 	form.Add("thirdWechatGroupId", openCompanyCode)
 	form.Add("deadline", deadline)
+	form.Add("status", status)
 
-	utils.FileLog.Info("SendThs parms:%s", form.Encode())
+	utils.FileLog.Info(fmt.Sprintf("SendThs SyncWxGroup parms:%s", form.Encode()))
 	resp, err := client.PostForm(sendUrl, form)
 	if err != nil {
 		return
@@ -352,7 +372,7 @@ func SyncWxGroup(openCompanyCode, deadline string) (err error) {
 	body, _ := ioutil.ReadAll(resp.Body)
 
 	fmt.Println(string(body))
-	utils.FileLog.Info("ThsResult parms:%s", string(body))
+	utils.FileLog.Info(fmt.Sprintf("SyncWxGroup ThsResult parms:%s", string(body)))
 
 	//同花顺接口返回数据
 	var tshResult TshResult

+ 39 - 26
services/task.go

@@ -171,7 +171,7 @@ func OneMinute(cont context.Context) (err error) {
 
 func RefreshData(cont context.Context) (err error) {
 	wg := sync.WaitGroup{}
-	wg.Add(7)
+	wg.Add(8)
 	//wind
 	go data.RefreshDataFromWind(&wg)
 	//同花顺
@@ -186,6 +186,8 @@ func RefreshData(cont context.Context) (err error) {
 	go data.RefreshDataFromYs(&wg)
 	//钢联
 	go data.RefreshDataFromGl(&wg)
+	//路透
+	go data.RefreshDataFromLt(&wg)
 
 	wg.Wait()
 	//计算指标
@@ -215,8 +217,6 @@ func RefreshTradeData(cont context.Context) (err error) {
 	//计算指标
 	data.RefreshDataFromCalculateAll()
 
-	time.Sleep(2 * time.Second)
-	data.RefreshNotice()
 	return
 }
 
@@ -343,24 +343,29 @@ func AddEdbTask(cont context.Context) (err error) {
 	nowYearLastDay := utils.GetNowYearLastDay()
 
 	debugNoticeUserId := 0 //测试环境,需要发送消息的用户
-	if utils.RunMode == "debug" {
-		tmpWxUser, tmpErr := models.GetWxUserByMobile("17634786714")
-		if tmpErr == nil && tmpWxUser != nil {
-			//debugNoticeUserId = 44078 //测试环境的话,发送邮箱给颜鹏
-			debugNoticeUserId = int(tmpWxUser.UserId) //测试环境的话,发送邮箱给嘉豪
-		}
-	}
+	//测试环境也不发了
+	//if utils.RunMode == "debug" {
+	//	tmpWxUser, tmpErr := models.GetWxUserByMobile("17634786714")
+	//	if tmpErr == nil && tmpWxUser != nil {
+	//		//debugNoticeUserId = 44078 //测试环境的话,发送邮箱给颜鹏
+	//		debugNoticeUserId = int(tmpWxUser.UserId) //测试环境的话,发送邮箱给嘉豪
+	//	}
+	//}
+
 	//task.globalTaskManager.adminTaskList
 	for _, edb := range list {
+		if edb.UserId <= 0 {
+			continue //没有配置user_id的话,那么不需要提醒
+		}
 		tmpEdb := edb            //指标信息
 		isNotice := false        //是否需要提醒
 		noticeTime := "12:00:00" //提醒时间
 
 		var dataDtTime time.Time
-		edbData, tmpErr := models.GetLastEdbdataInfo(edb.TradeCode)
+		edbData, tmpErr := models.GetLastEdbdataInfo(tmpEdb.TradeCode)
 		if tmpErr != nil {
 			if tmpErr.Error() != utils.ErrNoRow() {
-				failList = append(failList, fmt.Sprint(edb.TradeCode, "失败,Err:", tmpErr.Error()))
+				failList = append(failList, fmt.Sprint(tmpEdb.TradeCode, "失败,Err:", tmpErr.Error()))
 				continue
 			}
 		}
@@ -371,12 +376,12 @@ func AddEdbTask(cont context.Context) (err error) {
 			dataDtTime = tmpDataDtTime
 		}
 
-		switch edb.Frequency {
+		switch tmpEdb.Frequency {
 		case "周度":
 			modifyDate := nowWeekLastDay //下次更新日期
-			if edb.NoticeTime != "" {
+			if tmpEdb.NoticeTime != "" {
 				addDay := 7
-				noticeArr := strings.Split(edb.NoticeTime, " ")
+				noticeArr := strings.Split(tmpEdb.NoticeTime, " ")
 				if len(noticeArr) >= 2 {
 					noticeTime = noticeArr[1]
 				}
@@ -407,8 +412,8 @@ func AddEdbTask(cont context.Context) (err error) {
 		case "月度":
 			addDay := 0
 			modifyDate := nowMonthLastDay //下次更新日期
-			if edb.NoticeTime != "" {
-				strArr := strings.Split(edb.NoticeTime, "日")
+			if tmpEdb.NoticeTime != "" {
+				strArr := strings.Split(tmpEdb.NoticeTime, "日")
 				if len(strArr) >= 2 {
 					noticeTime = strArr[1]
 				}
@@ -426,8 +431,8 @@ func AddEdbTask(cont context.Context) (err error) {
 			}
 		case "季度":
 			//提醒时间
-			if edb.NoticeTime != "" {
-				noticeArr := strings.Split(edb.NoticeTime, " ")
+			if tmpEdb.NoticeTime != "" {
+				noticeArr := strings.Split(tmpEdb.NoticeTime, " ")
 				if len(noticeArr) >= 2 {
 					noticeTime = noticeArr[1]
 				}
@@ -439,8 +444,8 @@ func AddEdbTask(cont context.Context) (err error) {
 			}
 		case "半年度":
 			//提醒时间
-			if edb.NoticeTime != "" {
-				noticeArr := strings.Split(edb.NoticeTime, " ")
+			if tmpEdb.NoticeTime != "" {
+				noticeArr := strings.Split(tmpEdb.NoticeTime, " ")
 				if len(noticeArr) >= 2 {
 					noticeTime = noticeArr[1]
 				}
@@ -452,8 +457,8 @@ func AddEdbTask(cont context.Context) (err error) {
 			}
 		case "年度":
 			//提醒时间
-			if edb.NoticeTime != "" {
-				noticeArr := strings.Split(edb.NoticeTime, " ")
+			if tmpEdb.NoticeTime != "" {
+				noticeArr := strings.Split(tmpEdb.NoticeTime, " ")
 				if len(noticeArr) >= 2 {
 					noticeTime = noticeArr[1]
 				}
@@ -466,8 +471,8 @@ func AddEdbTask(cont context.Context) (err error) {
 		}
 
 		if isNotice {
-			taskName := "edb_task_" + todayStr + ":" + fmt.Sprint(edb.TradeCode)
-			//fmt.Println(taskName, ";", edb.SecName)
+			taskName := "edb_task_" + todayStr + ":" + fmt.Sprint(tmpEdb.TradeCode)
+			//fmt.Println(taskName, ";", tmpEdb.SecName)
 
 			//定时任务
 			tmpTaskFunc := func(ctx context.Context) (funcErr error) {
@@ -497,8 +502,12 @@ func AddEdbTask(cont context.Context) (err error) {
 					funcDataDtTime = tmpDataDtTime
 				}
 
+				//提示频度文案
+				notifyFrequency := "每日"
+
 				switch tmpEdb.Frequency {
 				case "周度":
+					notifyFrequency = "每周"
 					modifyDate := nowWeekLastDay //下次更新日期
 					if tmpEdb.NoticeTime != "" {
 						addDay := 7
@@ -531,6 +540,7 @@ func AddEdbTask(cont context.Context) (err error) {
 						funcIsNotice = true
 					}
 				case "月度":
+					notifyFrequency = "每月"
 					addDay := 0
 					modifyDate := nowMonthLastDay //下次更新日期
 					if tmpEdb.NoticeTime != "" {
@@ -551,6 +561,7 @@ func AddEdbTask(cont context.Context) (err error) {
 						funcIsNotice = true
 					}
 				case "季度":
+					notifyFrequency = "每季度"
 					//提醒时间
 					if tmpEdb.NoticeTime != "" {
 						noticeArr := strings.Split(tmpEdb.NoticeTime, " ")
@@ -564,6 +575,7 @@ func AddEdbTask(cont context.Context) (err error) {
 						funcIsNotice = true
 					}
 				case "半年度":
+					notifyFrequency = "每半年度"
 					//提醒时间
 					if tmpEdb.NoticeTime != "" {
 						noticeArr := strings.Split(tmpEdb.NoticeTime, " ")
@@ -577,6 +589,7 @@ func AddEdbTask(cont context.Context) (err error) {
 						funcIsNotice = true
 					}
 				case "年度":
+					notifyFrequency = "每年"
 					//提醒时间
 					if tmpEdb.NoticeTime != "" {
 						noticeArr := strings.Split(tmpEdb.NoticeTime, " ")
@@ -643,7 +656,7 @@ func AddEdbTask(cont context.Context) (err error) {
 
 					first := "数据录入提醒"
 					keyword1 := tmpEdb.SecName
-					keyword2 := "每周 " + edb.NoticeTime
+					keyword2 := notifyFrequency + " " + tmpEdb.NoticeTime
 					remark := tmpEdb.SecName + "该更新了"
 
 					err = SendWxMsgWithFrequency(first, keyword1, keyword2, remark, openIdList)

+ 11 - 0
utils/common.go

@@ -725,3 +725,14 @@ func getMonthDay(year, month int) (days int) {
 	}
 	return
 }
+
+// SubStr 截取字符串(中文)
+func SubStr(str string, subLen int) string {
+	strRune := []rune(str)
+	bodyRuneLen := len(strRune)
+	if bodyRuneLen > subLen {
+		bodyRuneLen = subLen
+	}
+	str = string(strRune[:bodyRuneLen])
+	return str
+}

+ 17 - 2
utils/config.go

@@ -1,7 +1,9 @@
 package utils
 
 import (
+	"fmt"
 	beego "github.com/beego/beego/v2/adapter"
+	"github.com/beego/beego/v2/server/web"
 )
 
 var (
@@ -49,8 +51,21 @@ var (
 )
 
 func init() {
-	RunMode = beego.AppConfig.String("run_mode")
-	config, err := beego.AppConfig.GetSection(RunMode)
+	tmpRunMode, err := web.AppConfig.String("run_mode")
+	if err != nil {
+		panic("配置文件读取run_mode错误 " + err.Error())
+	}
+	RunMode = tmpRunMode
+	if RunMode == "" {
+		RunMode = "release"
+		configPath := `/home/code/config/hongze_task/conf/app.conf`
+		err := web.LoadAppConfig("ini", configPath)
+		if err != nil {
+			fmt.Println("web.LoadAppConfig Err:" + err.Error())
+		}
+	}
+
+	config, err := web.AppConfig.GetSection(RunMode)
 	if err != nil {
 		panic("配置文件读取错误 " + err.Error())
 	}

+ 3 - 1
utils/constants.go

@@ -22,7 +22,7 @@ const (
 const (
 	APPNAME                        = "弘则-task"
 	EmailSendToUsers               = "317699326@qq.com;984198890@qq.com;512188925@qq.com"
-	RefreshEdbInfoEmailSendToUsers = "317699326@qq.com;jhwang@hzinsights.com;lnyan@hzinsights.com;vwang@hzinsights.com"
+	RefreshEdbInfoEmailSendToUsers = "317699326@qq.com;984198890@qq.com;jhwang@hzinsights.com;lnyan@hzinsights.com;vwang@hzinsights.com"
 )
 
 //手机号,电子邮箱正则
@@ -87,6 +87,7 @@ const (
 	DATA_SOURCE_CALCULATE_TIME_SHIFT            //时间移位->22
 	DATA_SOURCE_CALCULATE_ZJPJ                  //直接拼接->23
 	DATA_SOURCE_CALCULATE_LJZTBPJ               //累计值同比拼接->24
+	DATA_SOURCE_LT                              //路透->25
 )
 
 //http://datawind.hzinsights.com:8040/hz_server
@@ -94,6 +95,7 @@ const (
 const (
 	Hz_Data_Url    = "http://datawind.hzinsights.com:8040/" //同花顺,万得接口服务地址
 	Hz_Data_PB_Url = "http://datapb.hzinsights.com:8040/"   //彭博接口地址
+	Hz_Data_LT_Url = "http://dataek.hzinsights.com:8040/"   //路透社接口地址
 )
 
 //数据刷新频率