v2.0.0.sh 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/usr/bin/env bash
  2. git config core.ignorecase false
  3. chmod 777 /app/data/tmp -R
  4. service crond restart
  5. hostname=`hostname`
  6. domain=`php /app/bin/tools.php getDomain`
  7. port=`php /app/bin/tools.php getPort`
  8. #初始化统计数据
  9. curl -s http://${domain}:${port}/v2/tools/init?key=statistics
  10. #初始化报表
  11. curl -s http://${domain}:${port}/v2/tools/init?key=report
  12. #初始化票据
  13. curl -s http://${domain}:${port}/v2/tools/init?key=bill
  14. #初始化财务数据
  15. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=statement
  16. #同步账户
  17. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=reportAccount
  18. #同步票据金额
  19. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=billAmount
  20. #初始化管理员权限
  21. curl -s http://${domain}:${port}/v2/tools/init?key=rule
  22. #初始化管理员权限
  23. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=2019-02-14
  24. #初始化标签个数数据
  25. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=财务报表数据
  26. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=仓库报表数据
  27. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=加工进仓报表数据
  28. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=加工进度出仓报表数据
  29. curl -s http://${domain}:${port}/v2/tools/report-calculation?key=开票收票报表数据
  30. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=初始化管理员权限
  31. curl -s http://${domain}:${port}/v2/tools/report-forms-data-init?key=更新产品库模板
  32. #安装wkhtmltopdf
  33. if [ ! -x "$(command -v wkhtmltopdf)" ]; then
  34. yum install -y urw-fonts libXext openssl-devel libXrender
  35. wget -O /usr/share/fonts/simsun.ttc http://mi.lacecdn.com/docker/simsun.ttc
  36. wget -O /usr/share/fonts/simfang.ttf http://mi.lacecdn.com/docker/simfang.ttf
  37. wget -O /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz http://mi.lacecdn.com/docker/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  38. cd /tmp
  39. tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  40. rm -rf /usr/local/wkhtmltox
  41. mv wkhtmltox /usr/local/
  42. chmod +x /usr/local/wkhtmltox/bin/wkhtmltopdf
  43. chmod +x /usr/local/wkhtmltox/bin/wkhtmltoimage
  44. ln -sf /usr/local/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
  45. ln -sf /usr/local/wkhtmltox/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
  46. rm -rf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  47. fi