abiao лет назад: 5
Сommit
1c23e48ccb
100 измененных файлов с 7059 добавлено и 0 удалено
  1. 8 0
      go/gopath/src/DocTo/license.txt
  2. 186 0
      go/gopath/src/DocTo/readme.md
  3. 23 0
      go/gopath/src/DocTo/src/Both.bpg
  4. 48 0
      go/gopath/src/DocTo/src/Both.groupproj
  5. 6 0
      go/gopath/src/DocTo/src/Both.groupproj.local
  6. BIN
      go/gopath/src/DocTo/src/Debug/Linux64/MainUtils.dcu
  7. BIN
      go/gopath/src/DocTo/src/Debug/Linux64/PathUtils.dcu
  8. BIN
      go/gopath/src/DocTo/src/Debug/Linux64/ResourceUtils.dcu
  9. BIN
      go/gopath/src/DocTo/src/Debug/Linux64/datamodSSL.dcu
  10. BIN
      go/gopath/src/DocTo/src/Debug/Win32/ExcelUtils.dcu
  11. BIN
      go/gopath/src/DocTo/src/Debug/Win32/MainUtils.dcu
  12. BIN
      go/gopath/src/DocTo/src/Debug/Win32/PathUtils.dcu
  13. BIN
      go/gopath/src/DocTo/src/Debug/Win32/ResourceUtils.dcu
  14. BIN
      go/gopath/src/DocTo/src/Debug/Win32/datamodSSL.dcu
  15. BIN
      go/gopath/src/DocTo/src/ExcelUtils.ico
  16. 74 0
      go/gopath/src/DocTo/src/ExcelUtils.lpi
  17. 33 0
      go/gopath/src/DocTo/src/ExcelUtils.lps
  18. 150 0
      go/gopath/src/DocTo/src/ExcelUtils.pas
  19. BIN
      go/gopath/src/DocTo/src/ExcelUtils.res
  20. BIN
      go/gopath/src/DocTo/src/MainUtils.dcu
  21. 1237 0
      go/gopath/src/DocTo/src/MainUtils.pas
  22. BIN
      go/gopath/src/DocTo/src/PathUtils.dcu
  23. 92 0
      go/gopath/src/DocTo/src/PathUtils.pas
  24. BIN
      go/gopath/src/DocTo/src/Release/Win32/ExcelUtils.dcu
  25. BIN
      go/gopath/src/DocTo/src/Release/Win32/MainUtils.dcu
  26. BIN
      go/gopath/src/DocTo/src/Release/Win32/PathUtils.dcu
  27. BIN
      go/gopath/src/DocTo/src/Release/Win32/ResourceUtils.dcu
  28. BIN
      go/gopath/src/DocTo/src/Release/Win32/XlsTo.exe
  29. BIN
      go/gopath/src/DocTo/src/Release/Win32/datamodSSL.dcu
  30. BIN
      go/gopath/src/DocTo/src/ResourceUtils.dcu
  31. 35 0
      go/gopath/src/DocTo/src/ResourceUtils.pas
  32. BIN
      go/gopath/src/DocTo/src/WordUtils.dcu
  33. 284 0
      go/gopath/src/DocTo/src/WordUtils.pas
  34. 105 0
      go/gopath/src/DocTo/src/XlsTo.dpr
  35. 734 0
      go/gopath/src/DocTo/src/XlsTo.dproj
  36. 26 0
      go/gopath/src/DocTo/src/XlsTo.dproj.local
  37. BIN
      go/gopath/src/DocTo/src/XlsTo.identcache
  38. BIN
      go/gopath/src/DocTo/src/XlsTo.res
  39. 10 0
      go/gopath/src/DocTo/src/XlsTo.stat
  40. BIN
      go/gopath/src/DocTo/src/XlsTo_Icon.ico
  41. 22 0
      go/gopath/src/DocTo/src/backup/ExcelUtils.lps
  42. 148 0
      go/gopath/src/DocTo/src/backup/ExcelUtils.pas
  43. BIN
      go/gopath/src/DocTo/src/d2icon.bmp
  44. BIN
      go/gopath/src/DocTo/src/d2icon_QhU_icon.ico
  45. BIN
      go/gopath/src/DocTo/src/datamodSSL.dcu
  46. 35 0
      go/gopath/src/DocTo/src/datamodSSL.dfm
  47. 29 0
      go/gopath/src/DocTo/src/datamodSSL.pas
  48. 40 0
      go/gopath/src/DocTo/src/docto.cfg
  49. 138 0
      go/gopath/src/DocTo/src/docto.dof
  50. 82 0
      go/gopath/src/DocTo/src/docto.dpr
  51. 63 0
      go/gopath/src/DocTo/src/docto.dpr.orig
  52. 743 0
      go/gopath/src/DocTo/src/docto.dproj
  53. 28 0
      go/gopath/src/DocTo/src/docto.dproj.local
  54. 147 0
      go/gopath/src/DocTo/src/docto.dproj.orig
  55. BIN
      go/gopath/src/DocTo/src/docto.identcache
  56. BIN
      go/gopath/src/DocTo/src/docto.res
  57. 10 0
      go/gopath/src/DocTo/src/docto.stat
  58. 1 0
      go/gopath/src/DocTo/src/docto.todo
  59. BIN
      go/gopath/src/DocTo/src/docto_Icon.ico
  60. BIN
      go/gopath/src/DocTo/src/docto_Icon1.ico
  61. 6 0
      go/gopath/src/DocTo/src/lib/x86_64-win64/ExcelUtils.compiled
  62. BIN
      go/gopath/src/DocTo/src/lib/x86_64-win64/PathUtils.ppu
  63. BIN
      go/gopath/src/DocTo/src/lib/x86_64-win64/ResourceUtils.ppu
  64. 12 0
      go/gopath/src/DocTo/src/res/HelpErrors.txt
  65. 3 0
      go/gopath/src/DocTo/src/res/HelpJSONLog.txt
  66. 86 0
      go/gopath/src/DocTo/src/res/HelpLog.txt
  67. 38 0
      go/gopath/src/DocTo/src/res/HelpLog.txt.orig
  68. 19 0
      go/gopath/src/DocTo/src/res/HelpWebHook.txt
  69. 5 0
      go/gopath/src/DocTo/src/res/WdCompatibilityMode.txt
  70. 137 0
      go/gopath/src/DocTo/src/res/wdEncoding.txt
  71. 22 0
      go/gopath/src/DocTo/src/res/wdFormats.txt
  72. 22 0
      go/gopath/src/DocTo/src/res/wdFormatsExt.txt
  73. 54 0
      go/gopath/src/DocTo/src/res/xlsFormats.txt
  74. 54 0
      go/gopath/src/DocTo/src/res/xlsFormatsExt.txt
  75. 6 0
      go/gopath/src/DocTo/src/wdFormats.rc
  76. BIN
      go/gopath/src/DocTo/src/wdFormats.res
  77. 5 0
      go/gopath/src/DocTo/src/xlsFormats.rc
  78. BIN
      go/gopath/src/DocTo/src/xlsFormats.res
  79. 13 0
      go/gopath/src/DocTo/test/testxlsrun.bat
  80. 141 0
      go/gopath/src/DocTo/xlsTo.md
  81. 10 0
      go/gopath/src/d5c-statement-api/Makefile
  82. 31 0
      go/gopath/src/d5c-statement-api/README.md
  83. 21 0
      go/gopath/src/d5c-statement-api/cache/init.go
  84. 19 0
      go/gopath/src/d5c-statement-api/conf/app.conf
  85. 54 0
      go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_day_add.go
  86. 96 0
      go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_day_grouth.go
  87. 61 0
      go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_month_add.go
  88. 99 0
      go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_month_grouth.go
  89. 58 0
      go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_day_add.go
  90. 96 0
      go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_day_grouth.go
  91. 64 0
      go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_month_add.go
  92. 99 0
      go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_month_grouth.go
  93. 95 0
      go/gopath/src/d5c-statement-api/controllers/cow_point_task/cow_point_task.go
  94. 254 0
      go/gopath/src/d5c-statement-api/controllers/cow_point_task/d5c_prize_record.go
  95. 271 0
      go/gopath/src/d5c-statement-api/controllers/cow_point_task/daily_game_record.go
  96. 144 0
      go/gopath/src/d5c-statement-api/controllers/cow_punch/cow_punch.go
  97. 293 0
      go/gopath/src/d5c-statement-api/controllers/d5c_article_controller/article_stat.go
  98. 106 0
      go/gopath/src/d5c-statement-api/controllers/d5c_bd_cash_order/take_cash_order_day.go
  99. 28 0
      go/gopath/src/d5c-statement-api/controllers/d5c_bonus_contoller/bonus_invest.go
  100. 0 0
      go/gopath/src/d5c-statement-api/controllers/d5c_bonus_contoller/bonus_month_invest_and_recharge.go

+ 8 - 0
go/gopath/src/DocTo/license.txt

@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) 2013 Toby Allen Toflidium Software
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 186 - 0
go/gopath/src/DocTo/readme.md

@@ -0,0 +1,186 @@
+# DocTo & XLSTo
+
+DocTo
+====
+
+Simple utility for converting a Microsoft Word Document '.doc' file to any other supported format 
+such as .txt .rtf .pdf.  
+
+Can also be used to convert .txt, .rtf to .doc or .pdf format.
+
+Can be used to convert older word documents to latest format.
+
+Must have Microsoft Word installed on host machine.
+
+Download Release From Github Releases - https://github.com/tobya/DocTo/releases/
+Further Information available at http://tobya.github.com/DocTo
+
+XLSTo
+=====
+
+Simple utility for converting an Excel Spreadsheet '.xls' file to any other supported file format such as .txt .csv .pdf etc.
+
+Can also be used to convert .csv, .txt to .xls .
+
+Can be used to convert older excel documents to latest format.
+
+Must have Microsoft Excel installed on host machine.
+
+Further information available [here](xlsTo.md)
+
+
+## Features
+
+  1. Convert Doc/RTF/Text file to any Word SaveAs Type Doc/Text/RTF/PDF
+  1. Single File Conversion
+  1. Multiple / Directory File Conversion
+  1. Delete after conversion
+  1. [Fire Webhook on each conversion.](https://github.com/tobya/DocTo#webhooks)
+
+  
+## Bugs and Features
+
+Please log an [issue](https://github.com/tobya/DocTo/issues) for any bugs, features or suggestions.
+
+
+## Examples
+
+### Single
+
+Convert Microsoft Word Document to text
+
+    docto -f C:\Directory\MyFile.doc -O "C:\Output Directory\MyTextFile.txt" -T wdFormatText
+
+Convert Microsoft Word Document to PDF (requires version of Microsoft Word that supports this).
+
+     docto -f C:\Directory\MyFile.doc -O "C:\Output Directory\MyTextFile.pdf" -T wdFormatPDF
+
+### Multiple Files and Folders
+
+Convert All Microsoft Word Documents in Directory and its Sub Directories to PDF
+
+    docto -f "C:\Dir with Spaces\FilesToConvert\" -O "C:\DirToOutput" -T wdFormatPDF  -OX .pdf
+
+#### Delete Origional File after Conversion ####
+
+Delete Origional Files after conversion (-R) . 
+
+    docto -f "C:\Dir with Spaces\FilesToConvert\" -O "C:\DirToOutput" -T wdFormatPDF  -OX .pdf -R true
+
+Webhooks
+========
+
+Add a Webhook to fire on each conversion (-W)
+
+    docto -f "C:\Dir with Spaces\FilesToConvert\" -O "C:\DirToOutput" -T wdFormatPDF  -OX .pdf  -W http://toflidium.com/webhooks/docto/webhook_test.php
+    
+A Webhook is a url that can be called on each converstion to give you the ability to repond externally whenever a file is converted.  Currently `https` address is experimental so log an [issue](https://github.com/tobya/DocTo/issues/new) if you have any issues.
+
+Use in the Wild
+---------------
+
+If you are using DocTo in the wild somewhere, please add details to this [wiki page](https://github.com/tobya/DocTo/wiki/Uses-of-DocTo-in-the-wild)
+
+
+OneDrive Conversion
+=======================
+If you need to upgrade a bunch of files to work without conversion on OneDrive /Office365 / Word 20XX then you can use DocTo.
+See this StackExchange question 
+
+http://webapps.stackexchange.com/questions/74859/what-format-does-word-onedrive-use
+
+## Command Line Help
+
+    Help
+    Version:0.7.9
+    Source: http://github.com/tobya/DocTo/
+    Command Line Parameters
+    Each Parameter should be followed by its value  -f "c:\Docs\MyDoc.doc" -O "C:\MyDir\MyFile"
+    Parameters markers are case insensitive. Short and Long can be used mixed.
+      -H  This message
+          --help -?
+      -F  Input File or Directory.  Please use full path filename.
+          --inputfile
+      -FX Input Extension to search for if directory.  Default ".doc" (will find ".docx" also)
+          --inputextension
+      -O  Output File or Directory to place converted Docs
+          --outputfile
+      -OX Output Extension if -F is Directory. Please include '.' eg. '.pdf' .
+          If not provided, pulled from standard list.
+          --outputextension
+      -T  Format(Type) to convert file to, either integer or wdSaveFormat constant.
+          Available from http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.wdsaveformat.aspx
+          or http://msdn.microsoft.com/en-us/library/office/bb241279(v=office.12).aspx
+          See current List Below.
+          --format
+      -TF Force Format.  -T value if integer is checked against current list compiled in and not passed if unavailable.
+          -TF will pass through value without checking. Word will return an "EOleException  Value out of range" error if invalid.
+          Use instead of -T.
+          --forceformat
+      -L  Log Level Integer: 1 ERRORS Only, 2 STANDARD, 5 CHATTY, 10 VERBOSE
+          Default: 2=STANDARD
+          --loglevel
+      -C  Compatibility Mode Integer. Set to an INTEGER value from https://msdn.microsoft.com/en-us/library/office/ff192388.aspx.
+          Set the compatibility mode when you want to convert documents to a later version of word.
+          See List Below
+          --compatability
+      -E  Encoding Integer: Sets codepage Encoding.  See
+          https://msdn.microsoft.com/en-us/library/office/ff860880.aspx for more details and values.
+          --encoding          
+      -M  Ignore all files in __MACOSX\ subdirectory if it exists.  Default True.
+          --ignoremacos
+      -G  Write Log to file in directory
+          --writelogfile
+      -GL Log File Name to Use. Default 'DocTo.Log';
+          --logfilename
+      -Q  Quiet Mode: Nothing will be output to console.  To see any errors you must set -G or -GL
+          Equivalent to setting -L 0
+          --quiet
+      -R  Remove Files after successful conversion: Default false; To use specifiy value eg -R true
+          --deletefiles
+      -W  Webhook: Url to call on events (plain url no params). See -HW for more details.
+          --webhook
+      -HW Webhook Help.
+      -X  Halt on COM Error: Default True;  If you have trouble with some files not converting, set this to false to ignore
+          errors and continue with batch job.
+          --halterror
+      -V  Show Versions.  DocTo and Word/Excel
+    Extra Parameters
+
+      --skipdocswithtoc
+        EXPERIMENTAL.  Will skip any docs that contain a TOC to prevent hanging.
+        Currently matches some false positives.  Default False.
+
+    ERROR CODES:
+    200 : Invalid File Format specified
+    201 : Insufficient Inputs.  Minimum of Input File, Output File & Type
+    202 : Incorrect switches.  Switch requires value
+    203 : Unknown switch in command
+    204 : Input File does not exist
+    220 : Word or COM Error
+    221 : Word not Installed
+    400 : Unknown Error
+
+    COMPATIBILITY MODES:
+    FROM https://msdn.microsoft.com/en-us/library/office/ff836084.aspx
+
+    wdCurrent   : 65535 Compatibility mode equivalent to the latest version of Microsoft Word.
+    wdWord2003  : 11    Word 2010 is put into a mode that is most compatible with Word 2003.
+                        Features new to Word 2010 are disabled in this mode.
+    wdWord2007  : 12    Word 2010 is put into a mode that is most compatible with Office Word 2007.
+                        Features new to Word 2010 are disabled in this mode.
+    wdWord2010  : 14    Word 2013 is put into a mode that is most compatible with . Features new to
+                        Word 2013 are disabled in this mode.
+    wdWord2013  : 15    Default. All Word 2013 features are enabled.
+
+## Get Involved.
+
+The project complies with Delphi (I use XE4 but it should compile with most versions including 7). I am happy to accept any PR anyone might like to submit.
+
+## Updates     
+
+0.7     Added support for saveas2 function (with compatibility mode) added by microsoft in Word 2010.  Additional Switches. Added support for long parameters.
+
+0.5.5   Changes made to logging.  -Q and -L 0 now work correctly ensuring nothing is output to console.  Must specify -G or -GL to get access to logs and errors.
+                                Also -L 10 now outputs extra as logging param is loaded first.
+

+ 23 - 0
go/gopath/src/DocTo/src/Both.bpg

@@ -0,0 +1,23 @@
+#------------------------------------------------------------------------------
+VERSION = BWS.01
+#------------------------------------------------------------------------------
+!ifndef ROOT
+ROOT = $(MAKEDIR)\..
+!endif
+#------------------------------------------------------------------------------
+MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
+DCC = $(ROOT)\bin\dcc32.exe $**
+BRCC = $(ROOT)\bin\brcc32.exe $**
+#------------------------------------------------------------------------------
+PROJECTS = docto.exe XlsTo.exe
+#------------------------------------------------------------------------------
+default: $(PROJECTS)
+#------------------------------------------------------------------------------
+
+docto.exe: docto.dpr
+  $(DCC)
+
+XlsTo.exe: XlsTo.dpr
+  $(DCC)
+
+

+ 48 - 0
go/gopath/src/DocTo/src/Both.groupproj

@@ -0,0 +1,48 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{6B0932C5-1137-4CE7-A8A9-A857372840A6}</ProjectGuid>
+    </PropertyGroup>
+    <ItemGroup>
+        <Projects Include="docto.dproj">
+            <Dependencies/>
+        </Projects>
+        <Projects Include="XlsTo.dproj">
+            <Dependencies/>
+        </Projects>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Default.Personality.12</Borland.Personality>
+        <Borland.ProjectType/>
+        <BorlandProject>
+            <Default.Personality/>
+        </BorlandProject>
+    </ProjectExtensions>
+    <Target Name="docto">
+        <MSBuild Projects="docto.dproj"/>
+    </Target>
+    <Target Name="docto:Clean">
+        <MSBuild Projects="docto.dproj" Targets="Clean"/>
+    </Target>
+    <Target Name="docto:Make">
+        <MSBuild Projects="docto.dproj" Targets="Make"/>
+    </Target>
+    <Target Name="XlsTo">
+        <MSBuild Projects="XlsTo.dproj"/>
+    </Target>
+    <Target Name="XlsTo:Clean">
+        <MSBuild Projects="XlsTo.dproj" Targets="Clean"/>
+    </Target>
+    <Target Name="XlsTo:Make">
+        <MSBuild Projects="XlsTo.dproj" Targets="Make"/>
+    </Target>
+    <Target Name="Build">
+        <CallTarget Targets="docto;XlsTo"/>
+    </Target>
+    <Target Name="Clean">
+        <CallTarget Targets="docto:Clean;XlsTo:Clean"/>
+    </Target>
+    <Target Name="Make">
+        <CallTarget Targets="docto:Make;XlsTo:Make"/>
+    </Target>
+    <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
+</Project>

+ 6 - 0
go/gopath/src/DocTo/src/Both.groupproj.local

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<BorlandProject>
+	<Default.Personality>
+		<Projects ActiveProject="C:\WorkSpace\D5C\DocTo\src\XlsTo.dproj"/>
+	</Default.Personality>
+</BorlandProject>

BIN
go/gopath/src/DocTo/src/Debug/Linux64/MainUtils.dcu


BIN
go/gopath/src/DocTo/src/Debug/Linux64/PathUtils.dcu


BIN
go/gopath/src/DocTo/src/Debug/Linux64/ResourceUtils.dcu


BIN
go/gopath/src/DocTo/src/Debug/Linux64/datamodSSL.dcu


BIN
go/gopath/src/DocTo/src/Debug/Win32/ExcelUtils.dcu


BIN
go/gopath/src/DocTo/src/Debug/Win32/MainUtils.dcu


BIN
go/gopath/src/DocTo/src/Debug/Win32/PathUtils.dcu


BIN
go/gopath/src/DocTo/src/Debug/Win32/ResourceUtils.dcu


BIN
go/gopath/src/DocTo/src/Debug/Win32/datamodSSL.dcu


BIN
go/gopath/src/DocTo/src/ExcelUtils.ico


+ 74 - 0
go/gopath/src/DocTo/src/ExcelUtils.lpi

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <General>
+      <Flags>
+        <UseDefaultCompilerOptions Value="True"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
+      <Title Value="ExcelUtils"/>
+      <Scaled Value="True"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+      <Icon Value="0"/>
+    </General>
+    <BuildModes Count="1">
+      <Item1 Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+      <Modes Count="0"/>
+    </RunParams>
+    <RequiredPackages Count="1">
+      <Item1>
+        <PackageName Value="LCL"/>
+      </Item1>
+    </RequiredPackages>
+    <Units Count="1">
+      <Unit0>
+        <Filename Value="ExcelUtils.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit0>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="ExcelUtils"/>
+    </Target>
+    <SearchPaths>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 33 - 0
go/gopath/src/DocTo/src/ExcelUtils.lps

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectSession>
+    <PathDelim Value="\"/>
+    <Version Value="11"/>
+    <BuildModes Active="Default"/>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="ExcelUtils.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UsageCount Value="20"/>
+        <Loaded Value="True"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="datamodSSL.pas"/>
+        <IsVisibleTab Value="True"/>
+        <EditorIndex Value="1"/>
+        <CursorPos X="3" Y="6"/>
+        <UsageCount Value="10"/>
+        <Loaded Value="True"/>
+      </Unit1>
+    </Units>
+    <JumpHistory Count="1">
+      <Position1>
+        <Filename Value="ExcelUtils.pas"/>
+      </Position1>
+    </JumpHistory>
+    <RunParams>
+      <FormatVersion Value="2"/>
+      <Modes Count="0" ActiveMode=""/>
+    </RunParams>
+  </ProjectSession>
+</CONFIG>

+ 150 - 0
go/gopath/src/DocTo/src/ExcelUtils.pas

@@ -0,0 +1,150 @@
+unit ExcelUtils;
+(*************************************************************
+Copyright 2012 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software, to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+interface
+
+uses Classes,Sysutils, MainUtils, ResourceUtils,
+  ActiveX, ComObj, WinINet,
+  Variants,  Types;
+
+type
+
+TExcelXLSConverter = Class(TDocumentConverter)
+Private
+    ExcelApp : OleVariant;
+    FExcelVersion : String;
+
+public
+    constructor Create() ;
+    function CreateOfficeApp() : boolean;  override;
+    function DestroyOfficeApp() : boolean; override;
+    function ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): TConversionInfo; override;
+    function AvailableFormats() : TStringList; override;
+    function FormatsExtensions(): TStringList; override;
+    function OfficeAppVersion() : String; override;
+End;
+
+
+
+
+implementation
+
+
+
+function TExcelXLSConverter.AvailableFormats() : TStringList;
+var
+  Formats : TStringList;
+
+begin
+  Formats := Tstringlist.Create();
+  LoadStringListFromResource('EXCELFORMATS',Formats);
+
+  result := Formats;
+end;
+
+
+{ TWordDocConverter }
+
+constructor TExcelXLSConverter.Create;
+begin
+  inherited;
+  //setup defaults
+  InputExtension := '.xls';
+  FLogFilename := 'XlsTo.Log';
+end;
+
+function TExcelXLSConverter.CreateOfficeApp: boolean;
+begin
+    ExcelApp :=  CreateOleObject('Excel.Application');
+   // ExcelApp.Visible := false;
+   result := true;
+end;
+
+function TExcelXLSConverter.DestroyOfficeApp: boolean;
+begin
+  if not VarIsEmpty(ExcelApp) then
+  begin
+    ExcelApp.Quit;
+  end;
+  Result := true;
+end;
+
+function TExcelXLSConverter.ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): TConversionInfo;
+begin
+            //Open doc and save in requested format.
+
+            //Excel is particuarily sensitive to having \\ at end of filename, eg it won't create file.
+            //so we remove any double \\
+            log(OutputFilename, VERBOSE);
+            OutputFilename := stringreplace(OutputFilename, '\\', '\', [rfReplaceAll]);
+            log(OutputFilename, verbose);
+            ExcelApp.Workbooks.Open( FileToConvert);
+
+            //PDF and XPS are not an actual standard xls output format so we created our own.
+            if OutputFileFormat = 50000 then //pdf
+            begin
+                ExcelApp.Application.DisplayAlerts := False ;
+                //Unlike Word, in Excel you must call a different function to save a pdf. Ensure we export entire workbook.
+                ExcelApp.activeWorkbook.ExportAsFixedFormat(0, OutputFilename  );
+                ExcelApp.ActiveWorkBook.save;
+            end
+            else if OutputFileFormat = 50001 then //xps
+            begin
+                ExcelApp.Application.DisplayAlerts := False ;
+                //Unlike Word, in Excel you must call a different function to save a pdf. Ensure we export entire workbook.
+                ExcelApp.activeWorkbook.ExportAsFixedFormat(1, OutputFilename  );
+                ExcelApp.ActiveWorkBook.save;
+            end
+            else if OutputFileFormat = 6 then //CSV
+             begin
+              //CSV pops up alert. must be hidden for automation
+                ExcelApp.Application.DisplayAlerts := False ;
+                ExcelApp.activeWorkbook.SaveAs( OutputFilename, OutputFileFormat);
+                ExcelApp.ActiveWorkBook.save;
+             end
+            else
+            begin
+              //Excel has a tendency to popup alerts so we don't want that.
+              ExcelApp.Application.DisplayAlerts := False ;
+              ExcelApp.activeWorkbook.SaveAs( OutputFilename, OutputFileFormat);
+              ExcelApp.ActiveWorkBook.Save;
+
+            end;
+
+            ExcelApp.ActiveWorkbook.Close();
+end;
+
+
+function TExcelXLSConverter.FormatsExtensions: TStringList;
+var
+  Extensions : TStringList;
+
+begin
+  Extensions := Tstringlist.Create();
+  LoadStringListFromResource('EXTENSIONS',Extensions);
+
+  result := Extensions;
+end;
+
+function TExcelXLSConverter.OfficeAppVersion: String;
+begin
+  if FExcelVersion = '' then
+  begin
+  CreateOfficeApp();
+  FExcelVersion := ExcelApp.Version;
+  end;
+  result := FExcelVersion;
+end;
+
+end.

BIN
go/gopath/src/DocTo/src/ExcelUtils.res


BIN
go/gopath/src/DocTo/src/MainUtils.dcu


Разница между файлами не показана из-за своего большого размера
+ 1237 - 0
go/gopath/src/DocTo/src/MainUtils.pas


BIN
go/gopath/src/DocTo/src/PathUtils.dcu


+ 92 - 0
go/gopath/src/DocTo/src/PathUtils.pas

@@ -0,0 +1,92 @@
+unit PathUtils;
+(*************************************************************
+Copyright © 2012 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+interface
+uses sysutils, Classes;
+
+  type
+  TPath = Class
+  Private
+    FPath : String;
+    FParts : TStringList;
+
+    function GetParts: TStringList;
+    function GetExt: String;
+    function GetFileExists: Boolean;
+
+  public
+    Constructor Create(Path : String);
+    Destructor Destroy;  override;
+
+    Property Parts : TStringList  read GetParts;
+    Property Extension : String read GetExt;
+    Property Exists : Boolean read GetFileExists;
+    function NewFileName(NewExtension : String) : String;
+
+
+  End;
+implementation
+
+{ TPath }
+
+constructor TPath.Create(Path: String);
+begin
+    FPath := Path;
+end;
+
+
+
+destructor TPath.Destroy;
+begin
+  if Assigned(FParts) then FParts.Free;
+
+  inherited destroy;
+  
+end;
+
+function TPath.GetExt: String;
+begin
+   result := ExtractFileExt(FPath);
+end;
+
+function TPath.GetFileExists: Boolean;
+begin
+ Result :=  FileExists(FPath) ;
+ 
+end;
+
+function TPath.GetParts: TStringList;
+var
+  Drive, Folder, Filename : String;
+begin
+  Drive := ExtractFileDrive(FPath);
+  Folder := ExtractFileDir(FPath);
+  Filename := ExtractFileName(FPath);
+
+  if not assigned(FParts) then FParts := TStringlist.Create();
+
+  FParts.add('Drive=' + Drive + ':\');
+  FParts.Add('Folder=' + Folder);
+  FParts.Add('Filename=' + Filename);
+  FParts.Add('Ext=' + Extension);
+
+  Result := FParts;
+end;
+
+function TPath.NewFileName(NewExtension: String): String;
+begin
+
+end;
+
+end.

BIN
go/gopath/src/DocTo/src/Release/Win32/ExcelUtils.dcu


BIN
go/gopath/src/DocTo/src/Release/Win32/MainUtils.dcu


BIN
go/gopath/src/DocTo/src/Release/Win32/PathUtils.dcu


BIN
go/gopath/src/DocTo/src/Release/Win32/ResourceUtils.dcu


BIN
go/gopath/src/DocTo/src/Release/Win32/XlsTo.exe


BIN
go/gopath/src/DocTo/src/Release/Win32/datamodSSL.dcu


BIN
go/gopath/src/DocTo/src/ResourceUtils.dcu


+ 35 - 0
go/gopath/src/DocTo/src/ResourceUtils.pas

@@ -0,0 +1,35 @@
+unit ResourceUtils;
+(*************************************************************
+Copyright © 2012 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+interface
+
+uses Classes;
+
+procedure LoadStringListFromResource(const ResName: string;SL : TStringList);
+
+implementation
+
+
+procedure LoadStringListFromResource(const ResName: string;SL : TStringList);
+var
+  RS: TResourceStream;
+begin
+  RS := TResourceStream.Create(HInstance, ResName, 'Text');
+  try
+    SL.LoadFromStream(RS);
+  finally
+    RS.Free;
+  end;
+end;
+end.

BIN
go/gopath/src/DocTo/src/WordUtils.dcu


+ 284 - 0
go/gopath/src/DocTo/src/WordUtils.pas

@@ -0,0 +1,284 @@
+unit WordUtils;
+(*************************************************************
+Copyright © 2012 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+interface
+uses Classes, MainUtils, ResourceUtils,
+  ActiveX, ComObj, WinINet,
+  Variants, sysutils, Types, StrUtils;
+
+type
+
+TWordDocConverter = Class(TDocumentConverter)
+Private
+    FWordVersion : String;
+    WordApp : OleVariant;
+public
+    Constructor Create();
+    function CreateOfficeApp() : boolean;  override;
+    function DestroyOfficeApp() : boolean; override;
+    function ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): TConversionInfo; override;
+    function AvailableFormats() : TStringList; override;
+    function FormatsExtensions(): TStringList; override;
+    function OfficeAppVersion() : String; override;
+End;
+
+
+const
+
+wdDoNotSaveChanges    =	 0; //	Do not save pending changes.
+wdSaveChanges         =	-1; //	Save pending changes automatically without prompting the user.
+wdPromptToSaveChanges	= -2;	//  Prompt the user to save pending changes.
+
+
+
+
+implementation
+
+function TWordDocConverter.AvailableFormats() : TStringList;
+var
+  Formats : TStringList;
+
+begin
+  Formats := Tstringlist.Create();
+  LoadStringListFromResource('WORDFORMATS',Formats);
+
+  result := Formats;
+end;
+
+function TWordDocConverter.FormatsExtensions() : TStringList;
+var
+  Extensions : TStringList;
+
+begin
+  Extensions := Tstringlist.Create();
+  LoadStringListFromResource('EXTENSIONS',Extensions);
+
+  result := Extensions;
+end;
+
+
+
+
+
+function TWordDocConverter.OfficeAppVersion: String;
+var
+  WdVersion: String;
+  decimalPos : integer;
+begin
+  if FWordVersion = '' then
+  begin
+    CreateOfficeApp();
+    WdVersion := Wordapp.Version;
+    log('WordVersion:' + WdVersion,VERBOSE);
+
+    //Get Major version as that is all we are interested in and strtofloat causes errors Issue#31
+    decimalPos := pos('.',WdVersion);
+    FWordVersion  := LeftStr(WdVersion,decimalPos -1);
+    log('WordVersion Major:' + FWordVersion,VERBOSE);
+  end;
+  result := FWordVersion;
+end;
+
+{ TWordDocConverter }
+
+constructor TWordDocConverter.Create;
+begin
+  inherited;
+  InputExtension := '.doc*';
+  LogFilename := 'DocTo.Log';
+end;
+
+function TWordDocConverter.CreateOfficeApp: boolean;
+begin
+  if  VarIsEmpty(WordApp) then
+  begin
+    Wordapp :=  CreateOleObject('Word.Application');
+    Wordapp.Visible := false;
+  end;
+  Result := true;
+end;
+
+function TWordDocConverter.DestroyOfficeApp: boolean;
+begin
+  if not VarIsEmpty(WordApp) then
+  begin
+    WordApp.Quit();
+  end;
+  Result := true;
+end;
+
+function TWordDocConverter.ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): TConversionInfo;
+Type
+  TWordExitAction = (aSave,aClose, aExit);
+var
+  wdEncoding : OleVariant;
+  NonsensePassword : OleVariant;
+  WordExitAction : TWordExitAction;
+
+begin
+        WordExitAction := aSave;
+        Result.Successful := false;
+        Result.InputFile := fileToConvert;
+        log('ExecuteConversion:' + fileToConvert, Verbose);
+
+        // Check if document has password as per
+        // http://wordmvp.com/FAQs/MacrosVBA/CheckIfPWProtectB4Open.htm
+        // Always open with password, if none it will be ignored,
+        // if the file has a password set then we can catch error.
+        NonsensePassword := 'tfm554!ghAGWRDD';
+
+        try
+          //Open doc and save in requested format.
+          Wordapp.documents.Open( FileToConvert,  // FileName
+                                false,          // ConfirmConversions
+                                true,            // ReadOnly
+                                EmptyParam,    // AddToRecentFiles,
+                                NonsensePassword    // PasswordDocument,
+                                    // PasswordTemplate,
+                                    // Revert,
+                                   // WritePasswordDocument,
+                                   // WritePasswordTemplate,
+                                    // Format,
+                                   // Encoding,
+                                   // Visible,
+                                    // OpenAndRepair,
+                                    // DocumentDirection,
+                                    // NoEncodingDialog,
+                                    // XMLTransform     *)
+
+                                );
+
+          // For some reason if the document contains a TableofContents, it hangs Word.  In older
+          // versions it popped up a dialog.  Until someone can find a work around, the docs will be skipped.
+          // Issue  #40  - experimental as it gets some false positives.
+          if SkipDocsWithTOC then
+          begin
+            if Wordapp.ActiveDocument.TablesOfContents.count > 0 then
+            begin
+             log('SKIPPED - Document has TOC: ' + fileToConvert , STANDARD);
+             Result.Error := 'SKIPPED - Document has TOC:';
+              WordExitAction := aClose;
+            end;
+          end;
+        except
+        on E: Exception do
+        begin
+          // if Errro contains EOleException The password is incorrect.
+          // then it is password protected and should be skipped.
+          if ContainsStr(E.Message, 'The password is incorrect' ) then
+          begin
+             log('SKIPPED - Password Protected:' + fileToConvert, STANDARD);
+             Result.Error := 'SKIPPED - Password Protected:';
+             WordExitAction := aExit;
+          end
+          else
+          begin
+            // fallback error log
+            logerror(ConvertErrorText(E.ClassName) + ' ' + ConvertErrorText(E.Message));
+            Result.Successful := false;
+            Result.OutputFile := '';
+            Result.Error := E.Message;
+            Exit();
+          end;
+        end;
+
+
+        end;
+
+        if Encoding = -1 then
+        begin
+           wdEncoding := EmptyParam;
+        end
+        else
+        begin
+           wdEncoding := Encoding;
+        end;
+
+      case WordExitAction of
+      aExit :
+      begin
+        // document wasnt opened, so jus exit function.
+        Result.Successful := false;
+        Result.OutputFile := '';
+        Exit();
+      end;
+      aClose:
+      begin
+        WordApp.activeDocument.Close(wdDoNotSaveChanges);
+      end;
+      aSave:
+      begin
+        try
+            //SaveAs2 was introducted in 2010 V 14 by this list
+            //http://stackoverflow.com/a/29077879/6244
+            if (strtoint( OfficeAppVersion) < 14) then
+            begin
+                  log('Version < 14 Using Saveas Function', VERBOSE);
+                  Wordapp.activedocument.Saveas(OutputFilename ,
+                                                OutputFileFormat,
+                                                EmptyParam, //LockComments,
+                                                EmptyParam, //Password,
+                                                EmptyParam, //AddToRecentFiles,
+                                                EmptyParam, //WritePassword,
+                                                EmptyParam, //ReadOnlyRecommended,
+                                                EmptyParam, //EmbedTrueTypeFonts,
+                                                EmptyParam, //SaveNativePictureFormat,
+                                                EmptyParam, //SaveFormsData,
+                                                EmptyParam, //SaveAsAOCELetter,
+                                                wdEncoding, //Encoding,
+                                                EmptyParam, //InsertLineBreaks,
+                                                EmptyParam, //AllowSubstitutions,
+                                                EmptyParam, //LineEnding,
+                                                EmptyParam //AddBiDiMarks
+                                                );
+
+            end
+            else
+            begin
+                  log('Version >= 14 Using Saveas2 Function', VERBOSE);
+                  Wordapp.activedocument.Saveas2(OutputFilename ,OutputFileFormat,
+                                            EmptyParam,  //LockComments
+                                            EmptyParam,  //Password
+                                            EmptyParam,  //AddToRecentFiles
+                                            EmptyParam,  //WritePassword
+                                            EmptyParam,  //ReadOnlyRecommended
+                                            EmptyParam,  //EmbedTrueTypeFonts
+                                            EmptyParam,  //SaveNativePictureFo
+                                            EmptyParam,  //SaveFormsData
+                                            EmptyParam,  //SaveAsAOCELetter
+                                            wdEncoding,  //Encoding
+                                            EmptyParam,  //InsertLineBreaks
+                                            EmptyParam,  //AllowSubstitutions
+                                            EmptyParam,  //LineEnding
+                                            EmptyParam,  //AddBiDiMarks
+                                            CompatibilityMode  //CompatibilityMode
+                                            );
+            end;
+            Result.Successful := true;
+            Result.OutputFile := OutputFilename;
+            Result.Error := '';
+            log('FileCreated: ' + OutputFilename, STANDARD);
+        finally
+                // Close the document - do not save changes if doc has changed in any way.
+                Wordapp.activedocument.Close(wdDoNotSaveChanges);
+        end;
+    end;
+    end;
+
+
+end;
+
+
+
+end.

+ 105 - 0
go/gopath/src/DocTo/src/XlsTo.dpr

@@ -0,0 +1,105 @@
+program xlsto;
+(*************************************************************
+Copyright ?2012 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 揝oftware?, to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 揂S IS? WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+{$APPTYPE CONSOLE}
+{$R 'xlsFormats.res' 'xlsFormats.rc'}
+{$R *.res}
+uses
+  SysUtils,
+  Classes, Comobj,
+  ActiveX, Winapi.Windows, Winapi.Messages,
+  ExcelUtils in 'ExcelUtils.pas',
+  MainUtils in 'MainUtils.pas',
+  ResourceUtils in 'ResourceUtils.pas',
+  PathUtils in 'PathUtils.pas';
+
+//发送字符串到指字句柄的窗口中 (接收窗体需用发送时的消息常量WM_COPYDATA)
+//procedure SendMessageData(AHandle: THandle; AStr: String);
+//var
+// sData: TCopyDataStruct;
+//begin
+//  sData.cbData := Length(AStr) + 1;
+//  //为传递的数据分配内存
+//  GetMem(sData.lpData,sData.cbData );
+//  try
+//    StrCopy(sData.lpData,PChar(AStr));
+//    //发送WM_COPYDATA消息
+//    SendMessage(AHandle,WM_COPYDATA,0,Cardinal(@sData));
+//  finally
+//    FreeMem(sData.lpData); //释放资源
+//  end;
+//end;
+
+//发送消息到指字句柄的窗口中
+//procedure SendMyMessage(AHandle: THandle; aMsg:Word);
+//begin
+//  SendMessage(AHandle,aMsg,0,0)
+//end;
+
+const
+  cGuardClass  = 'TFrm_main_ConvertFile';
+
+var
+  i : integer;
+  paramlist : TStringlist;
+  XLSConv : TExcelXLSConverter;
+  vHW:HWND;
+  vSqe:integer;
+begin
+  vHW := Winapi.Windows.FindWindow(cGuardClass, nil);
+  paramlist := TStringlist.create;
+  try
+    try
+      try
+        XLSConv := TExcelXLSConverter.Create;
+        for i := 1 to ParamCount-1 do
+        begin
+          paramlist.Add(ParamStr(i));
+        end;
+
+        vSqe := Strtoint(ParamStr(ParamCount));
+
+  //      paramlist.Add('-f');
+  //      paramlist.Add('001.xlsx');
+  //      paramlist.Add('-O');
+  //      paramlist.Add('001.pdf');
+  //      paramlist.Add('-T');
+  //      paramlist.Add('xlTypePDF');
+  //      paramlist.Add('自定的数字');
+
+        CoInitialize(nil);
+        XLSConv.LoadConfig(paramlist);
+        XLSConv.Execute;
+        CoUninitialize;
+
+        //转换完成后 通知主程序成功
+        if vHW > 0 then
+        begin
+          PostMessage(vHW, WM_USER+1, vSqe, 0); //0表示成功
+        end;
+      finally
+        XLSConv.Free;
+      end;
+    except
+  //    if vHW > 0 then
+  //    begin
+  //      PostMessage(vHW, WM_USER+1, vSqe, 1); //0表示成功
+  //    end;
+    end;
+  finally
+    paramlist.Free;
+  end;
+end.

Разница между файлами не показана из-за своего большого размера
+ 734 - 0
go/gopath/src/DocTo/src/XlsTo.dproj


+ 26 - 0
go/gopath/src/DocTo/src/XlsTo.dproj.local

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<BorlandProject>
+	<Transactions>
+    <Transaction>1899-12-30 00:00:00.000.558,C:\Users\Toby\Documents\GitHub\DocTo\test\testxlsrun.bat=C:\Users\Toby\Documents\GitHub\DocTo\src\New1.bat</Transaction>
+    <Transaction>1899-12-30 00:00:00.000.208,D:\Development\GitHub\DocTo\src\xlsFormatsExt.txt=D:\Development\GitHub\DocTo\src\New1.txt</Transaction>
+    <Transaction>1899-12-30 00:00:00.000.964,C:\Users\Toby\Documents\GitHub\DocTo\src\res\xlsFormats.txt=C:\Users\Toby\Documents\GitHub\DocTo\src\New1.txt</Transaction>
+    <Transaction>1899-12-30 00:00:00.000.086,C:\Users\Toby\Documents\GitHub\DocTo\src\wdFormats.rc=C:\Users\Toby\Documents\GitHub\DocTo\src\xlsFormats.rc</Transaction>
+    <Transaction>1899-12-30 00:00:00.000.075,C:\Users\Toby\Documents\GitHub\DocTo\XlsTo.dproj=C:\Users\Toby\Documents\RAD Studio\Projects\Project2.dproj</Transaction>
+    <Transaction>2018-12-24 09:46:13.321,C:\WorkSpace\D5C\Source\dwc_IM\DocTo\src\alsto.dproj=C:\WorkSpace\D5C\Source\dwc_IM\DocTo\src\XlsTo.dproj</Transaction>
+    <Transaction>2018-12-24 09:46:28.959,C:\WorkSpace\D5C\Source\dwc_IM\DocTo\src\xlsto.dproj=C:\WorkSpace\D5C\Source\dwc_IM\DocTo\src\alsto.dproj</Transaction>
+  </Transactions>
+	<ProjectSortOrder AutoSort="0" SortType="0">
+    <File Path="..\..\DocTo"/>
+    <File Path="..\test"/>
+    <File Path="..\test\testxlsrun.bat"/>
+    <File Path="res"/>
+    <File Path="res\xlsFormats.txt"/>
+    <File Path="res\xlsFormatsExt.txt"/>
+    <File Path="xlsFormats.rc"/>
+    <File Path="ExcelUtils.pas"/>
+    <File Path="MainUtils.pas"/>
+    <File Path="ResourceUtils.pas"/>
+    <File Path="PathUtils.pas"/>
+    <File Path="xlsFormatsExt.txt"/>
+  </ProjectSortOrder>
+</BorlandProject>

BIN
go/gopath/src/DocTo/src/XlsTo.identcache


BIN
go/gopath/src/DocTo/src/XlsTo.res


+ 10 - 0
go/gopath/src/DocTo/src/XlsTo.stat

@@ -0,0 +1,10 @@
+[Stats]
+EditorSecs=3548
+DesignerSecs=2
+InspectorSecs=60
+CompileSecs=33724
+OtherSecs=252
+StartTime=2018-12-14 15:19:07
+RealKeys=0
+EffectiveKeys=0
+DebugSecs=1845

BIN
go/gopath/src/DocTo/src/XlsTo_Icon.ico


+ 22 - 0
go/gopath/src/DocTo/src/backup/ExcelUtils.lps

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectSession>
+    <PathDelim Value="\"/>
+    <Version Value="11"/>
+    <BuildModes Active="Default"/>
+    <Units Count="1">
+      <Unit0>
+        <Filename Value="ExcelUtils.pas"/>
+        <IsPartOfProject Value="True"/>
+        <IsVisibleTab Value="True"/>
+        <UsageCount Value="20"/>
+        <Loaded Value="True"/>
+      </Unit0>
+    </Units>
+    <JumpHistory HistoryIndex="-1"/>
+    <RunParams>
+      <FormatVersion Value="2"/>
+      <Modes Count="0" ActiveMode=""/>
+    </RunParams>
+  </ProjectSession>
+</CONFIG>

+ 148 - 0
go/gopath/src/DocTo/src/backup/ExcelUtils.pas

@@ -0,0 +1,148 @@
+unit ExcelUtils;
+(*************************************************************
+Copyright © 2012 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+interface
+
+uses Classes,Sysutils, MainUtils, ResourceUtils,  ActiveX, ComObj, WinINet, Variants,  Types;
+
+type
+
+TExcelXLSConverter = Class(TDocumentConverter)
+Private
+    ExcelApp : OleVariant;
+    FExcelVersion : String;
+
+public
+    constructor Create() ;
+    function CreateOfficeApp() : boolean;  override;
+    function DestroyOfficeApp() : boolean; override;
+    function ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): TConversionInfo; override;
+    function AvailableFormats() : TStringList; override;
+    function FormatsExtensions(): TStringList; override;
+    function OfficeAppVersion() : String; override;
+End;
+
+
+
+
+implementation
+
+
+
+function TExcelXLSConverter.AvailableFormats() : TStringList;
+var
+  Formats : TStringList;
+
+begin
+  Formats := Tstringlist.Create();
+  LoadStringListFromResource('EXCELFORMATS',Formats);
+
+  result := Formats;
+end;
+
+
+{ TWordDocConverter }
+
+constructor TExcelXLSConverter.Create;
+begin
+  inherited;
+  //setup defaults
+  InputExtension := '.xls';
+  FLogFilename := 'XlsTo.Log';
+end;
+
+function TExcelXLSConverter.CreateOfficeApp: boolean;
+begin
+    ExcelApp :=  CreateOleObject('Excel.Application');
+   // ExcelApp.Visible := false;
+   result := true;
+end;
+
+function TExcelXLSConverter.DestroyOfficeApp: boolean;
+begin
+  if not VarIsEmpty(ExcelApp) then
+  begin
+    ExcelApp.Quit;
+  end;
+  Result := true;
+end;
+
+function TExcelXLSConverter.ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): TConversionInfo;
+begin
+            //Open doc and save in requested format.
+
+            //Excel is particuarily sensitive to having \\ at end of filename, eg it won't create file.
+            //so we remove any double \\
+            log(OutputFilename, VERBOSE);
+            OutputFilename := stringreplace(OutputFilename, '\\', '\', [rfReplaceAll]);
+            log(OutputFilename, verbose);
+            ExcelApp.Workbooks.Open( FileToConvert);
+
+            //PDF and XPS are not an actual standard xls output format so we created our own.
+            if OutputFileFormat = 50000 then //pdf
+            begin
+                ExcelApp.Application.DisplayAlerts := False ;
+                //Unlike Word, in Excel you must call a different function to save a pdf. Ensure we export entire workbook.
+                ExcelApp.activeWorkbook.ExportAsFixedFormat(0, OutputFilename  );
+                ExcelApp.ActiveWorkBook.save;
+            end
+            else if OutputFileFormat = 50001 then //xps
+            begin
+                ExcelApp.Application.DisplayAlerts := False ;
+                //Unlike Word, in Excel you must call a different function to save a pdf. Ensure we export entire workbook.
+                ExcelApp.activeWorkbook.ExportAsFixedFormat(1, OutputFilename  );
+                ExcelApp.ActiveWorkBook.save;
+            end
+            else if OutputFileFormat = 6 then //CSV
+             begin
+              //CSV pops up alert. must be hidden for automation
+                ExcelApp.Application.DisplayAlerts := False ;
+                ExcelApp.activeWorkbook.SaveAs( OutputFilename, OutputFileFormat);
+                ExcelApp.ActiveWorkBook.save;
+             end
+            else
+            begin
+              //Excel has a tendency to popup alerts so we don't want that.
+              ExcelApp.Application.DisplayAlerts := False ;
+              ExcelApp.activeWorkbook.SaveAs( OutputFilename, OutputFileFormat);
+              ExcelApp.ActiveWorkBook.Save;
+
+            end;
+
+            ExcelApp.ActiveWorkbook.Close();
+end;
+
+
+function TExcelXLSConverter.FormatsExtensions: TStringList;
+var
+  Extensions : TStringList;
+
+begin
+  Extensions := Tstringlist.Create();
+  LoadStringListFromResource('EXTENSIONS',Extensions);
+
+  result := Extensions;
+end;
+
+function TExcelXLSConverter.OfficeAppVersion: String;
+begin
+  if FExcelVersion = '' then
+  begin
+  CreateOfficeApp();
+  FExcelVersion := ExcelApp.Version;
+  end;
+  result := FExcelVersion;
+end;
+
+end.

BIN
go/gopath/src/DocTo/src/d2icon.bmp


BIN
go/gopath/src/DocTo/src/d2icon_QhU_icon.ico


BIN
go/gopath/src/DocTo/src/datamodSSL.dcu


+ 35 - 0
go/gopath/src/DocTo/src/datamodSSL.dfm

@@ -0,0 +1,35 @@
+object dmSSL: TdmSSL
+  OldCreateOrder = False
+  Height = 150
+  Width = 215
+  object IdHTTP1: TIdHTTP
+    IOHandler = IdSSLIOHandlerSocketOpenSSL1
+    AllowCookies = True
+    ProxyParams.BasicAuthentication = False
+    ProxyParams.ProxyPort = 0
+    Request.ContentLength = -1
+    Request.ContentRangeEnd = -1
+    Request.ContentRangeStart = -1
+    Request.ContentRangeInstanceLength = -1
+    Request.Accept = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
+    Request.BasicAuthentication = False
+    Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
+    Request.Ranges.Units = 'bytes'
+    Request.Ranges = <>
+    HTTPOptions = [hoForceEncodeParams]
+    Left = 80
+    Top = 88
+  end
+  object IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL
+    MaxLineAction = maException
+    Port = 0
+    DefaultPort = 0
+    SSLOptions.Method = sslvSSLv23
+    SSLOptions.SSLVersions = [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]
+    SSLOptions.Mode = sslmUnassigned
+    SSLOptions.VerifyMode = []
+    SSLOptions.VerifyDepth = 0
+    Left = 80
+    Top = 40
+  end
+end

+ 29 - 0
go/gopath/src/DocTo/src/datamodSSL.pas

@@ -0,0 +1,29 @@
+unit datamodSSL;
+
+interface
+
+uses
+  System.SysUtils, System.Classes, IdIOHandler, IdIOHandlerSocket,
+  IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdBaseComponent, IdComponent,
+  IdTCPConnection, IdTCPClient, IdHTTP;
+
+type
+  TdmSSL = class(TDataModule)
+    IdHTTP1: TIdHTTP;
+    IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL;
+  private
+    { Private declarations }
+  public
+    { Public declarations }
+  end;
+
+var
+  dmSSL: TdmSSL;
+
+implementation
+
+{%CLASSGROUP 'System.Classes.TPersistent'}
+
+{$R *.dfm}
+
+end.

+ 40 - 0
go/gopath/src/DocTo/src/docto.cfg

@@ -0,0 +1,40 @@
+-$A8
+-$B-
+-$C+
+-$D+
+-$E-
+-$F-
+-$G+
+-$H+
+-$I+
+-$J-
+-$K-
+-$L+
+-$M-
+-$N+
+-$O+
+-$P+
+-$Q-
+-$R-
+-$S-
+-$T-
+-$U-
+-$V+
+-$W-
+-$X+
+-$YD
+-$Z1
+-cg
+-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+-H+
+-W+
+-M
+-$M16384,1048576
+-K$00400000
+-E"..\exe"
+-N"..\dcu"
+-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
+-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
+-w-UNSAFE_TYPE
+-w-UNSAFE_CODE
+-w-UNSAFE_CAST

+ 138 - 0
go/gopath/src/DocTo/src/docto.dof

@@ -0,0 +1,138 @@
+[FileVersion]
+Version=7.0
+[Compiler]
+A=8
+B=0
+C=1
+D=1
+E=0
+F=0
+G=1
+H=1
+I=1
+J=0
+K=0
+L=1
+M=0
+N=1
+O=1
+P=1
+Q=0
+R=0
+S=0
+T=0
+U=0
+V=1
+W=0
+X=1
+Y=1
+Z=1
+ShowHints=1
+ShowWarnings=1
+UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
+NamespacePrefix=
+SymbolDeprecated=1
+SymbolLibrary=1
+SymbolPlatform=1
+UnitLibrary=1
+UnitPlatform=1
+UnitDeprecated=1
+HResultCompat=1
+HidingMember=1
+HiddenVirtual=1
+Garbage=1
+BoundsError=1
+ZeroNilCompat=1
+StringConstTruncated=1
+ForLoopVarVarPar=1
+TypedConstVarPar=1
+AsgToTypedConst=1
+CaseLabelRange=1
+ForVariable=1
+ConstructingAbstract=1
+ComparisonFalse=1
+ComparisonTrue=1
+ComparingSignedUnsigned=1
+CombiningSignedUnsigned=1
+UnsupportedConstruct=1
+FileOpen=1
+FileOpenUnitSrc=1
+BadGlobalSymbol=1
+DuplicateConstructorDestructor=1
+InvalidDirective=1
+PackageNoLink=1
+PackageThreadVar=1
+ImplicitImport=1
+HPPEMITIgnored=1
+NoRetVal=1
+UseBeforeDef=1
+ForLoopVarUndef=1
+UnitNameMismatch=1
+NoCFGFileFound=1
+MessageDirective=1
+ImplicitVariants=1
+UnicodeToLocale=1
+LocaleToUnicode=1
+ImagebaseMultiple=1
+SuspiciousTypecast=1
+PrivatePropAccessor=1
+UnsafeType=0
+UnsafeCode=0
+UnsafeCast=0
+[Linker]
+MapFile=0
+OutputObjs=0
+ConsoleApp=1
+DebugInfo=0
+RemoteSymbols=0
+MinStackSize=16384
+MaxStackSize=1048576
+ImageBase=4194304
+ExeDescription=
+[Directories]
+OutputDir=..\exe
+UnitOutputDir=..\dcu
+PackageDLLOutputDir=
+PackageDCPOutputDir=
+SearchPath=
+Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;dclOfficeXP;PictureShow;cefcomponent;tfmCommonD7;BCS;TMSD7;PerlRegExD7
+Conditionals=
+DebugSourceDirs=
+UsePackages=0
+[Parameters]
+RunParams=-h
+HostApplication=
+Launcher=
+UseLauncher=0
+DebugCWD=
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+[Version Info]
+IncludeVerInfo=1
+AutoIncBuild=0
+MajorVer=0
+MinorVer=3
+Release=2
+Build=14
+Debug=1
+PreRelease=1
+Special=0
+Private=0
+DLL=0
+Locale=6153
+CodePage=1252
+[Version Info Keys]
+CompanyName=Toflidium Software
+FileDescription=DocTo - Convert doc files to any available format
+FileVersion=0.3.2.14
+InternalName=
+LegalCopyright=Toby Allen
+LegalTrademarks=
+OriginalFilename=docto.exe
+ProductName=DocTo
+ProductVersion=0.3.0.0
+Comments=
+[Excluded Packages]
+c:\program files (x86)\borland\delphi7\Projects\Bpl\tfmStandAlone_D7.bpl=TFM Standalone Components D7

+ 82 - 0
go/gopath/src/DocTo/src/docto.dpr

@@ -0,0 +1,82 @@
+program docto;
+(*************************************************************
+Copyright ?2012-2016 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software?, to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS? WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+{$APPTYPE CONSOLE}
+{$R 'wdFormats.res' 'wdFormats.rc'}
+{$R *.res}
+uses
+  SysUtils,
+  Classes,
+  ActiveX, Winapi.Windows, Winapi.Messages,
+  WordUtils in 'WordUtils.pas',
+  MainUtils in 'MainUtils.pas',
+  ResourceUtils in 'ResourceUtils.pas',
+  PathUtils in 'PathUtils.pas',
+  datamodSSL in 'datamodSSL.pas' {dmSSL: TDataModule};
+
+const
+  cGuardClass  = 'TFrm_main_ConvertFile';
+
+var
+  i : integer;
+  paramlist : TStringlist;
+  DocConv : TWordDocConverter;
+  vHW:HWND;
+  vSqe:integer;
+//  LogResult : String;
+begin
+  vHW := Winapi.Windows.FindWindow(cGuardClass, nil);
+  paramlist := TStringlist.create;
+  try
+    try
+      DocConv := TWordDocConverter.Create;
+      try
+        for i := 1 to ParamCount-1 do
+        begin
+          paramlist.Add(ParamStr(i));
+        end;
+
+        vSqe := Strtoint(ParamStr(ParamCount));
+
+        CoInitialize(nil);
+        DocConv.LoadConfig(paramlist);
+        DocConv.Execute;
+
+//        LogResult :=  DocConv.Execute;
+//        DocConv.log( LogResult );
+
+        CoUninitialize;
+
+        if vHW > 0 then
+        begin
+          PostMessage(vHW, WM_USER+2, vSqe, 0); //0±íʾ³É¹¦
+        end;
+
+      finally
+        DocConv.free;
+      end;
+    except
+//      on E: Exception do
+//      begin
+//        Writeln('Exiting with Error 400: ' + E.ClassName );
+//        Writeln(E.Message);
+//        halt(400);
+//      end;
+    end;
+  finally
+    paramlist.Free;
+  end;
+end.

+ 63 - 0
go/gopath/src/DocTo/src/docto.dpr.orig

@@ -0,0 +1,63 @@
+program docto;
+{$IFOPT D-}{$WEAKLINKRTTI ON}{$ENDIF}
+{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
+(*************************************************************
+Copyright © 2012 Toby Allen (http://github.com/tobya)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+****************************************************************)
+{$APPTYPE CONSOLE}
+
+
+{$R *.res}
+uses
+  SysUtils,
+  Classes,
+  ActiveX,
+  WordUtils in 'WordUtils.pas',
+  MainUtils in 'MainUtils.pas',
+  ResourceUtils in 'ResourceUtils.pas',
+  PathUtils in 'PathUtils.pas';
+
+var
+  i : integer;
+  paramlist : TStringlist;
+  DocConv : TWordDocConverter;
+  LogResult : String;
+begin
+
+  paramlist := TStringlist.create;
+
+  try
+    DocConv := TDocumentConverter.Create;
+    try
+      for i := 1 to ParamCount do
+      begin
+       paramlist.Add(ParamStr(i));
+      end;
+
+      DocConv.LoadConfig(paramlist);
+
+      CoInitialize(nil);
+      LogResult :=  DocConv.Execute;
+      DocConv.log( LogResult );
+
+      CoUninitialize;
+    finally
+      DocConv.free;
+    end;
+  finally
+    paramlist.Free;
+  end;
+
+end.

Разница между файлами не показана из-за своего большого размера
+ 743 - 0
go/gopath/src/DocTo/src/docto.dproj


+ 28 - 0
go/gopath/src/DocTo/src/docto.dproj.local

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<BorlandProject>
+	<Transactions>
+    <Transaction>1899-12-30 00:00:00.000.547,D:\Development\GitHub\DocTo\src\res\HelpErrors.txt=D:\Development\GitHub\DocTo\src\New1.txt</Transaction>
+    <Transaction>1899-12-30 00:00:00.000.644,D:\Development\GitHub\DocTo\src\Unit1.dfm=D:\Development\GitHub\DocTo\src\datamodSSL.dfm</Transaction>
+    <Transaction>1899-12-30 00:00:00.000.672,D:\Development\GitHub\DocTo\src\res\wdEncoding.txt=D:\Development\GitHub\DocTo\src\New1.txt</Transaction>
+  </Transactions>
+	<ProjectSortOrder AutoSort="0" SortType="0">
+    <File Path="..\..\DocTo"/>
+    <File Path="..\readme.md"/>
+    <File Path="res"/>
+    <File Path="res\HelpErrors.txt"/>
+    <File Path="res\HelpJSONLog.txt"/>
+    <File Path="res\HelpLog.txt"/>
+    <File Path="res\HelpWebHook.txt"/>
+    <File Path="res\WdCompatibilityMode.txt"/>
+    <File Path="res\wdEncoding.txt"/>
+    <File Path="res\wdFormats.txt"/>
+    <File Path="res\wdFormatsExt.txt"/>
+    <File Path="datamodSSL.pas"/>
+    <File Path="datamodSSL.dfm"/>
+    <File Path="MainUtils.pas"/>
+    <File Path="PathUtils.pas"/>
+    <File Path="ResourceUtils.pas"/>
+    <File Path="wdFormats.rc"/>
+    <File Path="WordUtils.pas"/>
+  </ProjectSortOrder>
+</BorlandProject>

+ 147 - 0
go/gopath/src/DocTo/src/docto.dproj.orig

@@ -0,0 +1,147 @@
+	<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+		<PropertyGroup>
+			<ProjectGuid>{2F967344-8067-49DA-9E3E-F6B7D7BC6CE5}</ProjectGuid>
+			<MainSource>docto.dpr</MainSource>
+			<Base>True</Base>
+			<Config Condition="'$(Config)'==''">Debug</Config>
+			<AppType>Console</AppType>
+			<FrameworkType>None</FrameworkType>
+			<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
+			<ProjectVersion>14.4</ProjectVersion>
+			<Platform Condition="'$(Platform)'==''">Win32</Platform>
+			<TargetedPlatforms>1</TargetedPlatforms>
+			<Platform>Win32</Platform>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
+			<Cfg_1>true</Cfg_1>
+			<CfgParent>Base</CfgParent>
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
+			<Cfg_2>true</Cfg_2>
+			<CfgParent>Base</CfgParent>
+			<Base>true</Base>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Base)'!=''">
+			<VerInfo_MinorVer>3</VerInfo_MinorVer>
+			<VerInfo_PreRelease>true</VerInfo_PreRelease>
+			<VerInfo_Locale>6153</VerInfo_Locale>
+			<VerInfo_MajorVer>0</VerInfo_MajorVer>
+			<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+			<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)</DCC_Namespace>
+			<VerInfo_Debug>true</VerInfo_Debug>
+			<VerInfo_Keys>CompanyName=Toflidium Software;FileDescription=DocTo - Convert doc files to any available format;FileVersion=0.3.2.15;InternalName=;LegalCopyright=Toby Allen;LegalTrademarks=;OriginalFilename=docto.exe;ProductName=DocTo;ProductVersion=0.3.0.0;Comments=</VerInfo_Keys>
+			<VerInfo_Release>2</VerInfo_Release>
+			<VerInfo_Build>15</VerInfo_Build>
+			<VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
+			<DCC_UsePackage>vclx;vcl;VclSmp;rtl;vclimg;svnui;svn;bdertl;TeeUI;TeeDB;Tee;vclactnband;vcldb;dbrtl;vcldbx;vcltouch;xmlrtl;dsnap;dsnapcon;vclib;ibxpress;adortl;IndyCore;IndySystem;IndyProtocols;inet;intrawebdb_110_150;Intraweb_110_150;vclie;inetdb;webdsnap;websnap;inetdbbde;inetdbxpress;soaprtl;vclribbon;DbxCommonDriver;DBXInterBaseDriver;DBXMySQLDriver;dbexpress;dbxcds;$(DCC_UsePackage)</DCC_UsePackage>
+			<DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
+			<DCC_E>false</DCC_E>
+			<DCC_ImageBase>00400000</DCC_ImageBase>
+			<DCC_N>true</DCC_N>
+			<DCC_S>false</DCC_S>
+			<DCC_F>false</DCC_F>
+			<DCC_K>false</DCC_K>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Cfg_1)'!=''">
+			<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+			<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+			<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+			<DCC_DebugInformation>false</DCC_DebugInformation>
+		</PropertyGroup>
+		<PropertyGroup Condition="'$(Cfg_2)'!=''">
+			<DCC_ExeOutput>../exe</DCC_ExeOutput>
+			<DCC_ConsoleTarget>true</DCC_ConsoleTarget>
+			<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+			<DCC_Optimize>false</DCC_Optimize>
+			<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+		</PropertyGroup>
+		<ItemGroup>
+			<DelphiCompile Include="docto.dpr">
+				<MainSource>MainSource</MainSource>
+			</DelphiCompile>
+			<DCCReference Include="WordUtils.pas"/>
+			<DCCReference Include="MainUtils.pas"/>
+			<DCCReference Include="ResourceUtils.pas"/>
+			<DCCReference Include="PathUtils.pas"/>
+			<None Include="..\readme.md"/>
+			<None Include="res\wdFormats.txt"/>
+			<None Include="res\HelpLog.txt"/>
+			<None Include="res\HelpJSONLog.txt"/>
+			<None Include="res\HelpWebHook.txt"/>
+			<None Include="docto.todo"/>
+			<None Include="res\wdFormatsExt.txt"/>
+			<BuildConfiguration Include="Debug">
+				<Key>Cfg_2</Key>
+				<CfgParent>Base</CfgParent>
+			</BuildConfiguration>
+			<BuildConfiguration Include="Base">
+				<Key>Base</Key>
+			</BuildConfiguration>
+			<BuildConfiguration Include="Release">
+				<Key>Cfg_1</Key>
+				<CfgParent>Base</CfgParent>
+			</BuildConfiguration>
+		</ItemGroup>
+		<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+		<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+		<ProjectExtensions>
+			<Borland.Personality>Delphi.Personality.12</Borland.Personality>
+			<Borland.ProjectType>VCLApplication</Borland.ProjectType>
+			<BorlandProject>
+				<Delphi.Personality>
+					<Source>
+						<Source Name="MainSource">docto.dpr</Source>
+					</Source>
+					<VersionInfo>
+						<VersionInfo Name="IncludeVerInfo">True</VersionInfo>
+						<VersionInfo Name="AutoIncBuild">True</VersionInfo>
+						<VersionInfo Name="MajorVer">0</VersionInfo>
+						<VersionInfo Name="MinorVer">4</VersionInfo>
+
+
+						<VersionInfo Name="Release">4</VersionInfo>
+						<VersionInfo Name="Build">28</VersionInfo>
+
+						<VersionInfo Name="Debug">True</VersionInfo>
+						<VersionInfo Name="PreRelease">True</VersionInfo>
+						<VersionInfo Name="Special">False</VersionInfo>
+						<VersionInfo Name="Private">False</VersionInfo>
+						<VersionInfo Name="DLL">False</VersionInfo>
+						<VersionInfo Name="Locale">1033</VersionInfo>
+						<VersionInfo Name="CodePage">1252</VersionInfo>
+					</VersionInfo>
+					<VersionInfoKeys>
+						<VersionInfoKeys Name="CompanyName">Toflidium Software</VersionInfoKeys>
+						<VersionInfoKeys Name="FileDescription"/>
+
+						<VersionInfoKeys Name="FileVersion">0.4.4.28</VersionInfoKeys>
+
+						<VersionInfoKeys Name="InternalName"/>
+						<VersionInfoKeys Name="LegalCopyright">Toflidium Software</VersionInfoKeys>
+						<VersionInfoKeys Name="LegalTrademarks"/>
+						<VersionInfoKeys Name="OriginalFilename"/>
+						<VersionInfoKeys Name="ProductName">DocTo</VersionInfoKeys>
+						<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+						<VersionInfoKeys Name="Comments"/>
+					</VersionInfoKeys>
+					<Parameters>
+						<Parameters Name="RunParams">-f &quot;C:\Temp\recipeZXLists\Courses\2010\12 Week September\Week 3\Mondaye\&quot;  -o c:\temp\myout -T wdFormatText -ox .txt -W &quot;http://home.hisbik.ie/webhooks/docto.php&quot;</Parameters>
+					</Parameters>
+					<Excluded_Packages>
+						<Excluded_Packages Name="$(BDSBIN)\dcloffice2k170.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
+						<Excluded_Packages Name="$(BDSBIN)\dclofficexp170.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
+					</Excluded_Packages>
+				</Delphi.Personality>
+				<Platforms>
+					<Platform value="OSX32">False</Platform>
+					<Platform value="Win64">False</Platform>
+					<Platform value="Win32">True</Platform>
+				</Platforms>
+			</BorlandProject>
+			<ProjectFileVersion>12</ProjectFileVersion>
+		</ProjectExtensions>
+	</Project>

BIN
go/gopath/src/DocTo/src/docto.identcache


BIN
go/gopath/src/DocTo/src/docto.res


+ 10 - 0
go/gopath/src/DocTo/src/docto.stat

@@ -0,0 +1,10 @@
+[Stats]
+EditorSecs=993
+DesignerSecs=1
+InspectorSecs=50
+CompileSecs=12761
+OtherSecs=191
+StartTime=2018-12-14 15:19:53
+RealKeys=0
+EffectiveKeys=0
+DebugSecs=6

+ 1 - 0
go/gopath/src/DocTo/src/docto.todo

@@ -0,0 +1 @@
+{TODO : new todo}

BIN
go/gopath/src/DocTo/src/docto_Icon.ico


BIN
go/gopath/src/DocTo/src/docto_Icon1.ico


+ 6 - 0
go/gopath/src/DocTo/src/lib/x86_64-win64/ExcelUtils.compiled

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <Compiler Value="C:\lazarus\fpc\3.0.4\bin\x86_64-win64\fpc.exe" Date="1297847685"/>
+  <Params Value=" -MObjFPC -Scghi -O1 -g -gl -WG -l -vewnhibq -FuC:\lazarus\lcl\units\x86_64-win64\win32 -FuC:\lazarus\lcl\units\x86_64-win64 -FuC:\lazarus\components\lazutils\lib\x86_64-win64 -FuC:\lazarus\packager\units\x86_64-win64 -FuC:\WorkSpace\D5C\DocTo\src\ -FUC:\WorkSpace\D5C\DocTo\src\lib\x86_64-win64\ -FEC:\WorkSpace\D5C\DocTo\src\ -oC:\WorkSpace\D5C\DocTo\src\ExcelUtils.exe -dLCL -dLCLwin32 ExcelUtils.pas"/>
+  <Complete Value="False"/>
+</CONFIG>

BIN
go/gopath/src/DocTo/src/lib/x86_64-win64/PathUtils.ppu


BIN
go/gopath/src/DocTo/src/lib/x86_64-win64/ResourceUtils.ppu


+ 12 - 0
go/gopath/src/DocTo/src/res/HelpErrors.txt

@@ -0,0 +1,12 @@
+Help Errors
+
+Possible Reasons for Errors.
+===========================
+ERROR 220
+
+File in Use:
+============
+When word is trying to saveas, if the file already exists but is in use, eg.
+Open or locked you will get this error.  Use Verbose logging to see if file
+exists before it is written to.
+

+ 3 - 0
go/gopath/src/DocTo/src/res/HelpJSONLog.txt

@@ -0,0 +1,3 @@
+JSON Format Help
+
+TODO!

+ 86 - 0
go/gopath/src/DocTo/src/res/HelpLog.txt

@@ -0,0 +1,86 @@
+Help
+Docto Version:%s
+Office Version : %s
+Source: http://github.com/tobya/DocTo/
+Command Line Parameters
+Each Parameter should be followed by its value  -f "c:\Docs\MyDoc.doc" -O "C:\MyDir\MyFile"
+Parameters markers are case insensitive. Short and Long can be used mixed.
+  -H  This message
+      --HELP -?
+  -F  Input File or Directory
+      --inputfile
+  -FX Input Extension to search for if directory.  Default "*.doc*" (will find ".docx" also)
+      --inputextension
+  -O  Output File or Directory to place converted Docs
+      --outputfile
+  -OX Output Extension if -F is Directory. Please include '.' eg. '.pdf' .
+      If not provided, pulled from standard list.
+      --outputextension
+  -T  Format(Type) to convert file to, either integer or wdSaveFormat constant.
+      Available from http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.wdsaveformat.aspx
+      or http://msdn.microsoft.com/en-us/library/office/bb241279(v=office.12).aspx
+      See current List Below.
+      --format
+  -TF Force Format.  -T value if integer is checked against current list compiled in 
+      and not passed if unavailable.
+      -TF will pass through value without checking. Word will return an 
+      "EOleException  Value out of range" error if invalid.
+      Use instead of -T.
+      --forceformat
+  -L  Log Level Integer: 1 ERRORS Only, 2 STANDARD, 5 CHATTY, 9 DEBUG, 10 VERBOSE
+      Default: 2=STANDARD
+      --loglevel
+  -C  Compatibility Mode Integer. Set to an INTEGER value from 
+      https://msdn.microsoft.com/en-us/library/office/ff192388.aspx.
+      Set the compatibility mode when you want to convert documents to a later version of word.
+      See List Below
+      --compatability
+  -E  Encoding Integer: Sets codepage Encoding.  See
+      https://msdn.microsoft.com/en-us/library/office/ff860880.aspx for more details and values.
+      --encoding
+  -M  Ignore all files in __MACOSX\ subdirectory if it exists.  Default True.
+      --ignoremacos
+  -G  Write Log to file in directory
+      --writelogfile
+  -GL Log File Name to Use. Default 'DocTo.Log';
+      --logfilename
+  -Q  Quiet Mode: Nothing will be output to console.  To see any errors you must 
+      set -G or -GL. Equivalent to setting -L 0
+      --quiet
+  -R  Remove Files after successful conversion: Default false; To use specifiy value eg -R true
+      --deletefiles
+  -W  Webhook: Url to call on events. See -HW for more details.
+      --webhook
+  -HW Webhook Help.
+  -X  Halt on COM Error: Default True;  If you have trouble with some files 
+      not converting, set this to false to ignore errors and continue with batch job.
+      --halterror
+  -V  Show Versions.  DocTo and Word/Excel
+
+Extra Parameters
+
+  --skipdocswithtoc
+      EXPERIMENTAL.  Will skip any docs that contain a TOC to prevent hanging.
+      Currently matches some false positives.  Default False.
+
+ERROR CODES:
+200 : Invalid File Format specified
+201 : Insufficient Inputs.  Minimum of Input File, Output File & Type
+202 : Incorrect switches.  Switch requires value
+203 : Unknown switch in command
+204 : Input File does not exist
+220 : Word or COM Error
+221 : Word not Installed
+400 : Unknown Error
+
+COMPATIBILITY MODES:
+FROM https://msdn.microsoft.com/en-us/library/office/ff836084.aspx
+
+wdCurrent   : 65535 Compatibility mode equivalent to the latest version of Microsoft Word.
+wdWord2003  : 11    Word 2010 is put into a mode that is most compatible with Word 2003.
+                    Features new to Word 2010 are disabled in this mode.
+wdWord2007  : 12    Word 2010 is put into a mode that is most compatible with Office Word 2007.
+                    Features new to Word 2010 are disabled in this mode.
+wdWord2010  : 14    Word 2013 is put into a mode that is most compatible with . Features new to
+                    Word 2013 are disabled in this mode.
+wdWord2013  : 15    Default. All Word 2013 features are enabled.

+ 38 - 0
go/gopath/src/DocTo/src/res/HelpLog.txt.orig

@@ -0,0 +1,38 @@
+Help
+Version:0.5.5
+
+Source: http://github.com/tobya/DocTo/
+Command Line Parameters
+Each Parameter should be followed by its value  -f "c:\Docs\MyDoc.doc" -O "C:\MyDir\MyFile"
+  -H  This message
+  -F  Input File or Directory
+  -O  Output File or Directory to place converted Docs
+  -OX Output Extension if -F is Directory.
+  -T  Format(Type) to convert file to, either integer or wdSaveFormat constant.
+      Available from http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.wdsaveformat.aspx  or
+      http://msdn.microsoft.com/en-us/library/office/bb241279(v=office.12).aspx
+      See current List Below.
+  -TF Force Format.  -T value if integer is checked against current list compiled in and not passed if unavailable.
+      To future proof, -TF will pass through value without checking.
+      Word will return an "EOleException  Value out of range" error if invalid.
+      Use instead of -T.
+  -L  Log Level 1 Errors Only, 2 Standard, 5 CHATTY, 10 VERBOSE
+      Default: 2 Standard
+  -G  Write Log to file in directory
+  -GL Log File Name to Use default 'DocTo.Log';
+  -Q  Quiet Mode: Nothing will be output to console.  To see any errors you must set -G or -GL
+      Equivalent to setting -L 0
+  -R  Remove Files after successful conversion: Default false;
+  -W  Webhook: Url to call on events (plain url no params). See -HW for more details.
+  -HW Webhook Help.
+  -X  Halt on COM Error: Default True;  If you have trouble with some files not converting, set this to false to ignore
+      errors and continue with batch job.
+
+
+ERROR CODES:
+200 : Invalid File Format specified
+201 : Insufficient Inputs.  Minimum of Input File, Output File & Type
+202 : Incorrect switches.  Switch requires value
+203 : Unknown switch in command
+220 : Word or COM Error
+221 : Word not Installed

+ 19 - 0
go/gopath/src/DocTo/src/res/HelpWebHook.txt

@@ -0,0 +1,19 @@
+Webhook Help
+
+The Webhook URL will be called on the following events with the following parameters
+
+  - File Converstion
+    - action=convert
+    - type=wdFormatType (or int if no matching format type)
+    - ouputfilename=File being written to.
+    - inputfilename=File being converted.
+
+  - Error
+    - action=error
+    - type=wdFormatType (or int if no matching format type)
+    - ouputfilename=File being written to.
+    - inputfilename=File being converted.
+    - error=Error Message
+
+Return value is ignored, no errors are logged.  This is a fire and forget Webhook.
+

+ 5 - 0
go/gopath/src/DocTo/src/res/WdCompatibilityMode.txt

@@ -0,0 +1,5 @@
+wdCurrent=65535
+wdWord2003=11
+wdWord2007=12
+wdWord2010=14
+wdWord2013=15

+ 137 - 0
go/gopath/src/DocTo/src/res/wdEncoding.txt

@@ -0,0 +1,137 @@
+msoEncodingArabic   =   1256
+msoEncodingArabicASMO   =   708
+msoEncodingArabicAutoDetect =   51256
+msoEncodingArabicTransparentASMO    =   720
+msoEncodingAutoDetect   =   50001
+msoEncodingBaltic   =   1257
+msoEncodingCentralEuropean  =   1250
+msoEncodingCyrillic =   1251
+msoEncodingCyrillicAutoDetect   =   51251
+msoEncodingEBCDICArabic =   20420
+msoEncodingEBCDICDenmarkNorway  =   20277
+msoEncodingEBCDICFinlandSweden  =   20278
+msoEncodingEBCDICFrance =   20297
+msoEncodingEBCDICGermany    =   20273
+msoEncodingEBCDICGreek  =   20423
+msoEncodingEBCDICGreekModern    =   875
+msoEncodingEBCDICHebrew =   20424
+msoEncodingEBCDICIcelandic  =   20871
+msoEncodingEBCDICInternational  =   500
+msoEncodingEBCDICItaly  =   20280
+msoEncodingEBCDICJapaneseKatakanaExtended   =   20290
+msoEncodingEBCDICJapaneseKatakanaExtendedAndJapanese    =   50930
+msoEncodingEBCDICJapaneseLatinExtendedAndJapanese   =   50939
+msoEncodingEBCDICKoreanExtended =   20833
+msoEncodingEBCDICKoreanExtendedAndKorean    =   50933
+msoEncodingEBCDICLatinAmericaSpain  =   20284
+msoEncodingEBCDICMultilingualROECELatin2    =   870
+msoEncodingEBCDICRussian    =   20880
+msoEncodingEBCDICSerbianBulgarian   =   21025
+msoEncodingEBCDICSimplifiedChineseExtendedAndSimplifiedChinese  =   50935
+msoEncodingEBCDICThai   =   20838
+msoEncodingEBCDICTurkish    =   20905
+msoEncodingEBCDICTurkishLatin5  =   1026
+msoEncodingEBCDICUnitedKingdom  =   20285
+msoEncodingEBCDICUSCanada   =   37
+msoEncodingEBCDICUSCanadaAndJapanese    =   50931
+msoEncodingEBCDICUSCanadaAndTraditionalChinese  =   50937
+msoEncodingEUCChineseSimplifiedChinese  =   51936
+msoEncodingEUCJapanese  =   51932
+msoEncodingEUCKorean    =   51949
+msoEncodingEUCTaiwaneseTraditionalChinese   =   51950
+msoEncodingEuropa3  =   29001
+msoEncodingExtAlphaLowercase    =   21027
+msoEncodingGreek    =   1253
+msoEncodingGreekAutoDetect  =   51253
+msoEncodingHebrew   =   1255
+msoEncodingHZGBSimplifiedChinese    =   52936
+msoEncodingIA5German    =   20106
+msoEncodingIA5IRV   =   20105
+msoEncodingIA5Norwegian =   20108
+msoEncodingIA5Swedish   =   20107
+msoEncodingISCIIAssamese    =   57006
+msoEncodingISCIIBengali =   57003
+msoEncodingISCIIDevanagari  =   57002
+msoEncodingISCIIGujarati    =   57010
+msoEncodingISCIIKannada =   57008
+msoEncodingISCIIMalayalam   =   57009
+msoEncodingISCIIOriya   =   57007
+msoEncodingISCIIPunjabi =   57011
+msoEncodingISCIITamil   =   57004
+msoEncodingISCIITelugu  =   57005
+msoEncodingISO2022CNSimplifiedChinese   =   50229
+msoEncodingISO2022CNTraditionalChinese  =   50227
+msoEncodingISO2022JPJISX02011989    =   50222
+msoEncodingISO2022JPJISX02021984    =   50221
+msoEncodingISO2022JPNoHalfwidthKatakana =   50220
+msoEncodingISO2022KR    =   50225
+msoEncodingISO6937NonSpacingAccent  =   20269
+msoEncodingISO885915Latin9  =   28605
+msoEncodingISO88591Latin1   =   28591
+msoEncodingISO88592CentralEurope    =   28592
+msoEncodingISO88593Latin3   =   28593
+msoEncodingISO88594Baltic   =   28594
+msoEncodingISO88595Cyrillic =   28595
+msoEncodingISO88596Arabic   =   28596
+msoEncodingISO88597Greek    =   28597
+msoEncodingISO88598Hebrew   =   28598
+msoEncodingISO88598HebrewLogical    =   38598
+msoEncodingISO88599Turkish  =   28599
+msoEncodingJapaneseAutoDetect   =   50932
+msoEncodingJapaneseShiftJIS =   932
+msoEncodingKOI8R    =   20866
+msoEncodingKOI8U    =   21866
+msoEncodingKorean   =   949
+msoEncodingKoreanAutoDetect =   50949
+msoEncodingKoreanJohab  =   1361
+msoEncodingMacArabic    =   10004
+msoEncodingMacCroatia   =   10082
+msoEncodingMacCyrillic  =   10007
+msoEncodingMacGreek1    =   10006
+msoEncodingMacHebrew    =   10005
+msoEncodingMacIcelandic =   10079
+msoEncodingMacJapanese  =   10001
+msoEncodingMacKorean    =   10003
+msoEncodingMacLatin2    =   10029
+msoEncodingMacRoman =   10000
+msoEncodingMacRomania   =   10010
+msoEncodingMacSimplifiedChineseGB2312   =   10008
+msoEncodingMacTraditionalChineseBig5    =   10002
+msoEncodingMacTurkish   =   10081
+msoEncodingMacUkraine   =   10017
+msoEncodingOEMArabic    =   864
+msoEncodingOEMBaltic    =   775
+msoEncodingOEMCanadianFrench    =   863
+msoEncodingOEMCyrillic  =   855
+msoEncodingOEMCyrillicII    =   866
+msoEncodingOEMGreek437G =   737
+msoEncodingOEMHebrew    =   862
+msoEncodingOEMIcelandic =   861
+msoEncodingOEMModernGreek   =   869
+msoEncodingOEMMultilingualLatinI    =   850
+msoEncodingOEMMultilingualLatinII   =   852
+msoEncodingOEMNordic    =   865
+msoEncodingOEMPortuguese    =   860
+msoEncodingOEMTurkish   =   857
+msoEncodingOEMUnitedStates  =   437
+msoEncodingSimplifiedChineseAutoDetect  =   50936
+msoEncodingSimplifiedChineseGB18030 =   54936
+msoEncodingSimplifiedChineseGBK =   936
+msoEncodingT61  =   20261
+msoEncodingTaiwanCNS    =   20000
+msoEncodingTaiwanEten   =   20002
+msoEncodingTaiwanIBM5550    =   20003
+msoEncodingTaiwanTCA    =   20001
+msoEncodingTaiwanTeleText   =   20004
+msoEncodingTaiwanWang   =   20005
+msoEncodingThai =   874
+msoEncodingTraditionalChineseAutoDetect =   50950
+msoEncodingTraditionalChineseBig5   =   950
+msoEncodingTurkish  =   1254
+msoEncodingUnicodeBigEndian =   1201
+msoEncodingUnicodeLittleEndian  =   1200
+msoEncodingUSASCII  =   20127
+msoEncodingUTF7 =   65000
+msoEncodingUTF8 =   65001
+msoEncodingVietnamese   =   1258
+msoEncodingWestern  =   1252

+ 22 - 0
go/gopath/src/DocTo/src/res/wdFormats.txt

@@ -0,0 +1,22 @@
+wdFormatDOSTextLineBreaks=5
+wdFormatEncodedText=7
+wdFormatFilteredHTML=10
+wdFormatOpenDocumentText=23
+wdFormatHTML=8
+wdFormatRTF=6
+wdFormatStrictOpenXMLDocument=24
+wdFormatTemplate=1
+wdFormatText=2
+wdFormatTextLineBreaks=3
+wdFormatUnicodeText=7
+wdFormatWebArchive=9
+wdFormatXML=11
+wdFormatDocument97=0
+wdFormatDocumentDefault=16
+wdFormatPDF=17
+wdFormatTemplate97=1
+wdFormatXMLDocument=12
+wdFormatXMLDocumentMacroEnabled=13
+wdFormatXMLTemplate=14
+wdFormatXMLTemplateMacroEnabled=15
+wdFormatXPS=18

+ 22 - 0
go/gopath/src/DocTo/src/res/wdFormatsExt.txt

@@ -0,0 +1,22 @@
+wdFormatDOSTextLineBreaks=txt
+wdFormatEncodedText=txt
+wdFormatFilteredHTML=html
+wdFormatOpenDocumentText=odt
+wdFormatHTML=html
+wdFormatRTF=rtf
+wdFormatStrictOpenXMLDocument=ODD
+wdFormatTemplate=dot
+wdFormatText=txt
+wdFormatTextLineBreaks=txt
+wdFormatUnicodeText=txt
+wdFormatWebArchive=weba
+wdFormatXML=xml
+wdFormatDocument97=doc
+wdFormatDocumentDefault=doc
+wdFormatPDF=pdf
+wdFormatTemplate97=dot
+wdFormatXMLDocument=xml
+wdFormatXMLDocumentMacroEnabled=xml
+wdFormatXMLTemplate=xml
+wdFormatXMLTemplateMacroEnabled=xml
+wdFormatXPS=xps

+ 54 - 0
go/gopath/src/DocTo/src/res/xlsFormats.txt

@@ -0,0 +1,54 @@
+xlAddIn=18
+xlCSV=6
+xlCSVMac=22
+xlCSVMSDOS=24
+xlCSVWindows=23
+xlCurrentPlatformText=-4158
+xlDBF2=7
+xlDBF3=8
+xlDBF4=11
+xlDIF=9
+xlExcel12=50
+xlExcel2=16
+xlExcel2FarEast=27
+xlExcel3=29
+xlExcel4=33
+xlExcel4Workbook=35
+xlExcel5=39
+xlExcel7=39
+xlExcel8=56
+xlExcel9795=43
+xlHtml=44
+xlIntlAddIn=26
+xlIntlMacro=25
+xlOpenDocumentSpreadsheet=60
+xlOpenXMLAddIn=55
+xlOpenXMLTemplate=54
+xlOpenXMLTemplateMacroEnabled=53
+xlOpenXMLWorkbook=51
+xlOpenXMLWorkbookMacroEnabled=52
+xlSYLK=2
+xlTemplate=17
+xlTextMac=19
+xlTextMSDOS=21
+xlTextPrinter=36
+xlTextWindows=20
+xlUnicodeText=42
+xlWebArchive=45
+xlWJ2WD1=14
+xlWJ3=40
+xlWJ3FJ3=41
+xlWK1=5
+xlWK1ALL=31
+xlWK1FMT=30
+xlWK3=15
+xlWK3FM3=32
+xlWK4=38
+xlWKS=4
+xlWorkbookDefault=51
+xlWorkbookNormal=-4143
+xlWorks2FarEast=28
+xlWQ1=34
+xlXMLSpreadsheet=46
+xlTypePDF=50000
+xlTypeXPS=50001

+ 54 - 0
go/gopath/src/DocTo/src/res/xlsFormatsExt.txt

@@ -0,0 +1,54 @@
+xlAddIn=xls
+xlCSV=csv
+xlCSVMac=csv
+xlCSVMSDOS=csv
+xlCSVWindows=csv
+xlCurrentPlatformText=txt
+xlDBF2=dbf
+xlDBF3=dbf
+xlDBF4=dbf
+xlDIF=dif
+xlExcel12=xls
+xlExcel2=xls
+xlExcel2FarEast=xls
+xlExcel3=xls
+xlExcel4=xls
+xlExcel4Workbook=xls
+xlExcel5=xls
+xlExcel7=xls
+xlExcel8=xls
+xlExcel9795=xls
+xlHtml=html
+xlIntlAddIn=xls
+xlIntlMacro=xls
+xlOpenDocumentSpreadsheet=ods
+xlOpenXMLAddIn=ods
+xlOpenXMLTemplate=ods
+xlOpenXMLTemplateMacroEnabled=ods
+xlOpenXMLWorkbook=ods
+xlOpenXMLWorkbookMacroEnabled=ods
+xlSYLK=syl
+xlTemplate=xls
+xlTextMac=txt
+xlTextMSDOS=txt
+xlTextPrinter=txt
+xlTextWindows=txt
+xlUnicodeText=txt
+xlWebArchive=html
+xlWJ2WD1=wj2
+xlWJ3=wj3
+xlWJ3FJ3=wj3
+xlWK1=wk
+xlWK1ALL=wk
+xlWK1FMT=wk
+xlWK3=wk
+xlWK3FM3=wk
+xlWK4=wk
+xlWKS=wk
+xlWorkbookDefault=xlsx
+xlWorkbookNormal=xlsx
+xlWorks2FarEast=xls
+xlWQ1=wq
+xlXMLSpreadsheet=xmlx
+xlTypePDF=pdf
+xlTypeXPS=xps

+ 6 - 0
go/gopath/src/DocTo/src/wdFormats.rc

@@ -0,0 +1,6 @@
+WORDFORMATS     TEXT    res\wdFormats.txt
+EXTENSIONS      TEXT    res\wdFormatsExt.txt
+HELP    TEXT    res\HelpLog.txt
+HELPJSON TEXT   res\HelpJSONLog.txt
+HELPWEBHOOK TEXT res\HelpWebHook.txt
+HELPERRORS TEXT res\HelpErrors.txt

BIN
go/gopath/src/DocTo/src/wdFormats.res


+ 5 - 0
go/gopath/src/DocTo/src/xlsFormats.rc

@@ -0,0 +1,5 @@
+EXCELFORMATS TEXT    res\xlsFormats.txt
+HELP    TEXT    res\HelpLog.txt
+HELPJSON TEXT   res\HelpJSONLog.txt
+HELPWEBHOOK TEXT res\HelpWebHook.txt
+EXTENSIONS TEXT res\xlsFormatsExt.txt

BIN
go/gopath/src/DocTo/src/xlsFormats.res


+ 13 - 0
go/gopath/src/DocTo/test/testxlsrun.bat

@@ -0,0 +1,13 @@
+REM XLSTO
+
+REM Convert Directory to pdf
+REM "../exe/xlsto.exe" -L 10  -f "%~d0%~p0Inputfiles\"  -o "%~d0%~p0GeneratedFiles"    -T  xlPDF -OX .pdf
+REM convert to csv
+REM Try on Single no output file with Verbose Logging
+REM "../exe/xlsto.exe" -L 10 -f "%~d0%~p0Inputfiles\Week 1 Test.xls"  -o "%~d0%~p0GeneratedFiles\myfile4742.csv"    -T  xlcsv -OX .csv
+ REM Load csv files convert to xls
+"../exe/xlsto.exe"  -f "%~d0%~p0Inputfiles\"  -o "%~d0%~p0GeneratedFiles"    -T  20 -OX .txt -FX .csv -L 10
+
+REM Full Dir
+  "../exe/xlsto.exe" -L 10  -f "%~d0%~p0Inputfiles\"  -o "%~d0%~p0GeneratedFiles"    -T  xlExcel9795 -OX .xls 
+

+ 141 - 0
go/gopath/src/DocTo/xlsTo.md

@@ -0,0 +1,141 @@
+# XLSTo
+
+Simple utility for converting an Excel Spreadsheet  '.xls' file to any other supported file format 
+such as .txt .csv .pdf etc.  
+
+Can also be used to convert .csv, .txt to .xls .
+
+Can be used to convert older excel documents to latest format.
+
+Must have Microsoft Excel installed on host machine.
+
+Download Release From Github Releases - https://github.com/tobya/DocTo/releases/
+Further Information available at http://tobya.github.com/DocTo
+
+DocTo
+=====
+Word version available - [Details here](readme.md)
+
+## Features
+
+  1. Convert XLS file to any Excel SaveAs Type XLS,CSV,TXT
+  1. Single File Conversion
+  1. Multiple / Directory File Conversion
+  1. Delete after conversion
+  1. Fire Webhook one each conversion.
+  
+## Bugs and Features
+
+Please log an [issue](https://github.com/tobya/DocTo/issues) for any bugs, features or suggestions.
+
+
+## Examples
+
+### Single
+
+Convert Microsoft Excel Document to csv text
+
+    xlsto -f C:\Directory\MyFile.xls -O "C:\Output Directory\MyTextFile.csv" -T xlCSV
+
+Convert Microsoft Excel Document to PDF (requires version of Microsoft Excel that supports this).
+
+     xlsto -f C:\Directory\MyFile.xls -O "C:\Output Directory\MyTextFile.pdf" -T xlTypePDF
+
+### Multiple Files and Folders
+
+Convert All Microsoft Excel Documents in Directory and its Sub Directories to PDF
+
+    xlsto -f "C:\Dir with Spaces\FilesToConvert\" -O "C:\DirToOutput" -T xlTypePDF  -OX .pdf
+
+#### Delete Origional File after Conversion ####
+
+Delete Origional Files after conversion (-R) . 
+
+    xlsto -f "C:\Dir with Spaces\FilesToConvert\" -O "C:\DirToOutput" -T xlTypePDF  -OX .pdf -R
+
+Webhooks
+========
+
+Add a Webhook to fire on each conversion (-W)
+
+    xlsto -f "C:\Dir with Spaces\FilesToConvert\" -O "C:\DirToOutput" -T xlTypePDF  -OX .pdf  -W http://toflidium.com/webhooks/docto/webhook_test.php
+    
+A Webhook is a url that can be called on each converstion to give you the ability to repond externally whenever a file is converted.
+
+Use in the Wild
+---------------
+
+If you are using XLSTo or DocTo in the wild somewhere, please add details to this [wiki page](https://github.com/tobya/DocTo/wiki/Uses-of-DocTo-in-the-wild)
+
+
+## Command Line Help
+
+    Help
+    Version:0.7.9
+    Source: http://github.com/tobya/DocTo/
+    Command Line Parameters
+    Each Parameter should be followed by its value  -f "c:\Docs\MyDoc.doc" -O "C:\MyDir\MyFile"
+    Parameters markers are case insensitive. Short and Long can be used mixed.
+      -H  This message
+          --help -?
+      -F  Input File or Directory
+          --inputfile
+      -FX Input Extension to search for if directory.  Default ".doc" (will find ".docx" also)
+          --inputextension
+      -O  Output File or Directory to place converted Docs
+          --outputfile
+      -OX Output Extension if -F is Directory. Please include '.' eg. '.pdf' .
+          If not provided, pulled from standard list.
+          --outputextension
+      -T  Format(Type) to convert file to, either integer or wdSaveFormat constant.
+          Available from http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.wdsaveformat.aspx
+          or http://msdn.microsoft.com/en-us/library/office/bb241279(v=office.12).aspx
+          See current List Below.
+          --format
+      -TF Force Format.  -T value if integer is checked against current list compiled in and not passed if unavailable.
+          -TF will pass through value without checking. Word will return an "EOleException  Value out of range" error if invalid.
+          Use instead of -T.
+          --forceformat
+      -L  Log Level Integer: 1 ERRORS Only, 2 STANDARD, 5 CHATTY, 10 VERBOSE
+          Default: 2=STANDARD
+          --loglevel
+      -C  Compatibility Mode Integer. Set to an INTEGER value from https://msdn.microsoft.com/en-us/library/office/ff192388.aspx.
+          Set the compatibility mode when you want to convert documents to a later version of word.
+          See List Below
+          --compatability
+      -E  Encoding Integer: Sets codepage Encoding.  See
+          https://msdn.microsoft.com/en-us/library/office/ff860880.aspx for more details and values.
+          --encoding          
+      -M  Ignore all files in __MACOSX\ subdirectory if it exists.  Default True.
+          --ignoremacos
+      -G  Write Log to file in directory
+          --writelogfile
+      -GL Log File Name to Use. Default 'DocTo.Log';
+          --logfilename
+      -Q  Quiet Mode: Nothing will be output to console.  To see any errors you must set -G or -GL
+          Equivalent to setting -L 0
+          --quiet
+      -R  Remove Files after successful conversion: Default false;
+          --deletefiles
+      -W  Webhook: Url to call on events (plain url no params). See -HW for more details.
+          --webhook
+      -HW Webhook Help.
+      -X  Halt on COM Error: Default True;  If you have trouble with some files not converting, set this to false to ignore
+          errors and continue with batch job.
+          --halterror
+      -V  Show Versions.  DocTo and Word/Excel
+
+
+    ERROR CODES:
+    200 : Invalid File Format specified
+    201 : Insufficient Inputs.  Minimum of Input File, Output File & Type
+    202 : Incorrect switches.  Switch requires value
+    203 : Unknown switch in command
+    204 : Input File does not exist
+    220 : Word or COM Error
+    221 : Word not Installed
+    400 : Unknown Error
+
+
+
+

+ 10 - 0
go/gopath/src/d5c-statement-api/Makefile

@@ -0,0 +1,10 @@
+all: build
+
+build:
+	go build -o d5c-statement-api ./main.go
+
+clean:
+	go clean -i ./...
+
+test:
+	go test -race ./...

+ 31 - 0
go/gopath/src/d5c-statement-api/README.md

@@ -0,0 +1,31 @@
+# 第五创统计报表系统
+
+
+## Quick Start
+
+#### 环境配置
+
+    根据 conf/app.conf 自行创建对应的文件, 后加载的会覆盖前加载的
+    dev/app.conf : 开发模式的配置
+    test/app.conf : 测试环境的配置
+    prod/app.conf : 生产环境的配置
+    
+    *** 不要把这些配置文件加入版本仓库 ***
+
+
+#### 运行
+
+```go
+
+bee run -gendoc=true
+
+```
+
+### 查看Api文档
+
+```
+
+http://localhost:8080/swagger-d5cd5c/
+
+
+```

+ 21 - 0
go/gopath/src/d5c-statement-api/cache/init.go

@@ -0,0 +1,21 @@
+package cache
+
+import (
+	"github.com/astaxie/beego/cache"
+)
+
+const (
+	DEL = "del"
+	GET = "get"
+)
+
+var Cache cache.Cache
+
+func init() {
+	var err error
+
+	Cache, err = cache.NewCache("memory", `{"interval":60}`)
+	if err != nil {
+		panic(err)
+	}
+}

+ 19 - 0
go/gopath/src/d5c-statement-api/conf/app.conf

@@ -0,0 +1,19 @@
+appname = d5c-statement-api
+httpport = 8080
+runmode = dev
+autorender = false
+copyrequestbody = true
+EnableDocs = true
+
+
+[dev]
+
+[test]
+
+[prod]
+
+
+# 以下文件 需要自行建立空白,并填充内容
+include "dev/app.conf"
+include "test/app.conf"
+include "prod/app.conf"

+ 54 - 0
go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_day_add.go

@@ -0,0 +1,54 @@
+package adopt_cows_controller
+
+import (
+	"github.com/astaxie/beego"
+	"strings"
+	"time"
+	"d5c-statement-api/models"
+)
+
+type CowsDayAddController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 粉丝某天的新增和净增数量,默认是当天的前一天
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *CowsDayAddController) Get(){
+
+	query_date := self.GetString("query_date")
+
+	s := strings.Split(query_date,"-")
+
+	now := time.Now()//2018-03-24 14:32:00
+	lastDay := now.AddDate(0,0,-1)//2018-03-23 14:32:00
+	queryDate := time.Date(lastDay.Year(), lastDay.Month(), lastDay.Day(), 0, 0,0 ,0, time.Local)//2018-03-23 00:00:00
+
+	if len(s) == 3 {
+		//2018-03-09 00:00:00
+		query_date, _ := time.Parse("2006-01-02", query_date)
+		queryDate = time.Date(query_date.Year(), query_date.Month(), query_date.Day(), 0, 0,0 ,0, time.Local)
+	}
+
+	type Ret struct {
+		QueryDate      string          `json:"query_date"`       //查询日期
+		CowsDayNewAdd  int64           `json:"fans_day_new_add"` //日期下粉丝新增(渠道关注+非渠道关注)
+		CowsDayNetAdd  int64           `json:"fans_day_net_add"` //日期下粉丝净增(渠道关注+非渠道关注-渠道取消关注-非渠道取消关注)
+	}
+
+	//2018-03-09 00:00:00----2018-03-10 00:00:00
+	//不分有没有渠道的所有领养牛仔总数
+	subCowCount := models.GetAllCowAdoptCowCount(queryDate, queryDate.AddDate(0,0,1), true)
+
+
+
+	self.Data["json"] = &Ret{QueryDate: queryDate.Format("2006-01-02"), CowsDayNewAdd: subCowCount, CowsDayNetAdd: subCowCount}
+
+	self.ServeJSON()
+
+
+
+}

+ 96 - 0
go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_day_grouth.go

@@ -0,0 +1,96 @@
+package adopt_cows_controller
+
+import (
+	"github.com/astaxie/beego"
+	"time"
+	"d5c-statement-api/models"
+	"strconv"
+	"strings"
+)
+
+
+type CowsDayGrouthController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 默认是昨天及其前6天,输入某个日期,查询输入日期及其前6天的净增和新增数组
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *CowsDayGrouthController) Get() {
+
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date,"-")
+	type Ret struct {
+		Days                []string `json:"days"`             //最近7天
+		DayNewCows          []int64  `json:"day_new_cows"`     //新增
+		DayNetCows          []int64  `json:"day_net_cows"`     //净增
+	}
+
+	now := time.Now()//2018-03-24 14:32:00
+	startTime := now.AddDate(0, 0, -7) //2018-03-17 14:32:00
+	nextTime := now//2018-03-24 14:32:00
+
+	// 2018-03-17 00:00:00
+	start := time.Date(startTime.Year(),startTime.Month(),startTime.Day(),0,0,0,0,time.Local)
+	// 2018-03-24 00:00:00
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(),0,0,0,0,time.Local)
+
+	if len(s) == 3 {
+		//2018-03-09 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(),0,0,0,0,time.Local)
+		//2018-03-03 00:00:00
+		start = queryDateTmp.AddDate(0, 0, -6) //前6天
+		beego.BeeLogger.Warn("start:%s",start)
+		//2018-03-10 00:00:00
+		end = queryDateTmp.AddDate(0,0,1)
+		beego.BeeLogger.Warn("end:%s",end)
+
+	}
+
+	adoptCowCountPerDayList := models.GetAllCowAdoptCowCountByDay(start, end, true)
+	//unSubUserCountPerDayList := models.GetAllCowUnSubUserCountByDay(start,end, true)
+	//subOtherCountPerDayList := models.GetSubOtherCountByDay(start, end)
+	//unSubOtherCountPerDayList := models.GetUnSubOtherCountByDay(start, end)
+
+	var days []string
+	var dayNewFans []int64
+	var dayNetFans []int64
+
+
+	for i := 0; i < 7; i++ {
+
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+
+		md := start.AddDate(0, 0, i).Format("20060102")
+
+		mdInt,_ := strconv.ParseInt(md, 0 ,64)
+		beego.BeeLogger.Warn("md:%s,mdint:%d",md,mdInt)
+
+		adopt := models.ContainsInDayItemListAndReturnItemCount(mdInt, adoptCowCountPerDayList)
+		//subOther := ContainsInDayListAndReturn(mdInt, subOtherCountPerDayList)
+		unAdopt := int64(0)
+		//unSubOther := ContainsInDayListAndReturn(mdInt, unSubOtherCountPerDayList)
+
+		//subOtherNet := subOther - unSubOther
+
+
+		dayNewF :=  adopt
+		beego.BeeLogger.Warn("dayNewF:%d", dayNewF)
+
+		dayNewFans = append(dayNewFans, dayNewF)
+
+		dayNetF := adopt - unAdopt
+		beego.BeeLogger.Warn("dayNetF:%d", dayNetF)
+
+		dayNetFans = append(dayNetFans, dayNetF)
+	}
+
+	self.Data["json"] = &Ret{Days:days, DayNewCows: dayNewFans,DayNetCows: dayNetFans}
+	self.ServeJSON()
+
+}

+ 61 - 0
go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_month_add.go

@@ -0,0 +1,61 @@
+package adopt_cows_controller
+
+import (
+	"strings"
+	"time"
+	"github.com/astaxie/beego"
+	"d5c-statement-api/models"
+)
+
+type CowsMonthAddController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 粉丝某月的新增和净增数量,如果没有输入日期,默认查询当月
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *CowsMonthAddController) Get(){
+
+	query_date := self.GetString("query_date")
+
+	s := strings.Split(query_date,"-")
+
+	now := time.Now()
+	queryDate := time.Date(now.Year(), now.Month(), 1, 0, 0,0 ,0, time.Local)
+
+	if len(s) == 3 {
+
+		query_date_tmp, _ := time.Parse("2006-01-02",query_date)
+		queryDate = time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0,0 ,0, time.Local)
+
+	}
+	if len(s) == 2 {
+
+		query_date, _ := time.Parse("2006-01",query_date)
+		queryDate = time.Date(query_date.Year(), query_date.Month(), 1, 0, 0,0 ,0, time.Local)
+
+	}
+
+	type Ret struct {
+		QueryDate      string            `json:"query_date"`       //查询日期
+		CowsMonthNewAdd  int64           `json:"cows_month_new_add"` //日期下粉丝新增(渠道关注+非渠道关注)
+		CowsMonthNetAdd  int64           `json:"cows_month_net_add"` //日期下粉丝净增(渠道关注+非渠道关注-渠道取消关注-非渠道取消关注)
+	}
+
+
+	//某月不分有没有渠道的所有领养牛仔总数
+	adoptCowCount := models.GetAllCowAdoptCowCount(queryDate, queryDate.AddDate(0,1,0),true)
+
+	//某月不分有没有渠道的所有领养牛仔总数
+	unAdoptCowCount := int64(0)
+
+
+	self.Data["json"] = &Ret{QueryDate: queryDate.Format("2006-01"), CowsMonthNewAdd: adoptCowCount, CowsMonthNetAdd: adoptCowCount - unAdoptCowCount}
+
+	self.ServeJSON()
+
+}
+

+ 99 - 0
go/gopath/src/d5c-statement-api/controllers/adopt_cows_controller/cows_month_grouth.go

@@ -0,0 +1,99 @@
+package adopt_cows_controller
+
+import (
+	"github.com/astaxie/beego"
+	"strings"
+	"time"
+	"d5c-statement-api/models"
+	"strconv"
+)
+
+type CowsMonthGrouthController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 默认是当月及其前5月,输入某个日期,查询输入日期月份及其前5月的净增和新增数组
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *CowsMonthGrouthController) Get(){
+
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date,"-")
+	type Ret struct {
+		Months                []string `json:"months"`             //六个月
+		MonthNewCows          []int64  `json:"month_new_cows"`     //新增
+		MonthNetCows          []int64  `json:"month_net_cows"`     //净增
+	}
+
+	now := time.Now()//2018-03-24 14:32:00
+	start := now
+	end := now
+
+	query_date_tmp := now
+	if len(s) == 3 {
+		//2018-02-09 00:00:00
+		query_date_tmp, _ = time.Parse("2006-01-02", query_date)
+	}
+	if len(s) == 2 {
+		//2018-02-01 00:00:00
+		query_date_tmp, _ = time.Parse("2006-01", query_date)
+	}
+
+	//2018-02-01 00:00:00
+	queryDate := time.Date(query_date_tmp.Year(),query_date_tmp.Month(),1,0,0,0,0,time.Local)
+
+	start = queryDate.AddDate(0, -5, 0) //2018-09-01 00:00:00
+	beego.BeeLogger.Warn("start:%s",start)
+
+	end = queryDate.AddDate(0,1,0)//2018-03-01 00:00:00
+	beego.BeeLogger.Warn("end:%s",end)
+
+
+	cowAdoptCountPerMonthList := models.GetAllCowAdoptCowCountByMonth(start, end, true)
+	//uncowAdoptCountPerMonthList := models.GetAllCowUncowAdoptCountByMonth(start,end, true)
+	//subOtherCountPerMonthList := models.GetSubOtherCountByMonth(start, end)
+	//unSubOtherCountPerMonthList := models.GetUnSubOtherCountByMonth(start, end)
+
+	var months []string
+	var MonthNewCows []int64
+	var MonthNetCows []int64
+
+
+	for i := 0; i < 6; i++ {
+
+		month := start.AddDate(0, i, 0).Format("2006-01")
+		months = append(months, month)
+
+		ym := start.AddDate(0, i, 0).Format("200601")
+
+		ymInt,_ := strconv.ParseInt(ym, 0 ,64)
+
+		sub := models.ContainsInMonthItemListAndReturnItemCount(ymInt, cowAdoptCountPerMonthList)
+		beego.BeeLogger.Warn("sub:%d",sub)
+		//subOther := ContainsInMonthListAndReturn(ymInt, subOtherCountPerMonthList)
+		//beego.BeeLogger.Warn("subOther:%d",subOther)
+		unSub := int64(0)
+		beego.BeeLogger.Warn("unSub:%d",unSub)
+		//unSubOther := ContainsInMonthListAndReturn(ymInt, unSubOtherCountPerMonthList)
+		//beego.BeeLogger.Warn("unSubOther:%d",unSubOther)
+
+		//subOtherNet := subOther - unSubOther
+
+
+		dayNewF :=  sub
+		beego.BeeLogger.Warn("monthNewF:%d", dayNewF)
+
+		MonthNewCows = append(MonthNewCows, dayNewF)
+
+		dayNetF := sub - unSub
+		beego.BeeLogger.Warn("monthNetF:%d", dayNetF)
+
+		MonthNetCows = append(MonthNetCows, dayNetF)
+	}
+
+	self.Data["json"] = &Ret{Months: months, MonthNewCows: MonthNewCows, MonthNetCows: MonthNetCows}
+	self.ServeJSON()
+}

+ 58 - 0
go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_day_add.go

@@ -0,0 +1,58 @@
+package cow_fans_controller
+
+import (
+	"github.com/astaxie/beego"
+	"strings"
+	"time"
+	"d5c-statement-api/models"
+)
+
+type FansDayAddController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 粉丝某天的新增和净增数量,默认是当天的前一天
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *FansDayAddController) Get(){
+
+	query_date := self.GetString("query_date")
+
+	s := strings.Split(query_date,"-")
+
+	now := time.Now()//2018-03-24 14:32:00
+	lastDay := now.AddDate(0,0,-1)//2018-03-23 14:32:00
+	queryDate := time.Date(lastDay.Year(), lastDay.Month(), lastDay.Day(), 0, 0,0 ,0, time.Local)//2018-03-23 00:00:00
+
+	if len(s) == 3 {
+		//2018-03-09 00:00:00
+		query_date, _ := time.Parse("2006-01-02", query_date)
+		queryDate = time.Date(query_date.Year(), query_date.Month(), query_date.Day(), 0, 0,0 ,0, time.Local)
+	}
+
+	type Ret struct {
+		QueryDate      string          `json:"query_date"`       //查询日期
+		FansDayNewAdd  int64           `json:"fans_day_new_add"` //日期下粉丝新增(渠道关注+非渠道关注)
+		FansDayNetAdd  int64           `json:"fans_day_net_add"` //日期下粉丝净增(渠道关注+非渠道关注-渠道取消关注-非渠道取消关注)
+		CowsDayNetAdd  int64           `json:"cows_day_net_add"` //日期下订单净增
+	}
+
+	//2018-03-09 00:00:00----2018-03-10 00:00:00
+	//不分有没有渠道的所有关注人数
+	subUserCount := models.GetAllCowSubUserCount(queryDate, queryDate.AddDate(0,0,1), true)
+	//不分有没有渠道的所有取消关注人数
+	unSubUserCount := models.GetAllCowUnSubUserCount(queryDate, queryDate.AddDate(0,0,1), true)
+	//统计当天订单净增
+	allCowCount := models.GetAllCowOrderCount(queryDate, queryDate.AddDate(0,0,1), true)
+
+	self.Data["json"] = &Ret{QueryDate: queryDate.Format("2006-01-02"), FansDayNewAdd: subUserCount, FansDayNetAdd: subUserCount - unSubUserCount, CowsDayNetAdd: allCowCount}
+
+
+	self.ServeJSON()
+
+
+
+}

+ 96 - 0
go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_day_grouth.go

@@ -0,0 +1,96 @@
+package cow_fans_controller
+
+import (
+	"github.com/astaxie/beego"
+	"time"
+	"d5c-statement-api/models"
+	"strconv"
+	"strings"
+)
+
+
+type FansDayGrouthController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 默认是昨天及其前6天,输入某个日期,查询输入日期及其前6天的净增和新增数组
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *FansDayGrouthController) Get() {
+
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date,"-")
+	type Ret struct {
+		Days                []string `json:"days"`             //最近7天
+		DayNewFans          []int64  `json:"day_new_fans"`     //新增
+		DayNetFans          []int64  `json:"day_net_fans"`     //净增
+	}
+
+	now := time.Now()//2018-03-24 14:32:00
+	startTime := now.AddDate(0, 0, -7) //2018-03-17 14:32:00
+	nextTime := now//2018-03-24 14:32:00
+
+	// 2018-03-17 00:00:00
+	start := time.Date(startTime.Year(),startTime.Month(),startTime.Day(),0,0,0,0,time.Local)
+	// 2018-03-24 00:00:00
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(),0,0,0,0,time.Local)
+
+	if len(s) == 3 {
+		//2018-03-09 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(),0,0,0,0,time.Local)
+		//2018-03-03 00:00:00
+		start = queryDateTmp.AddDate(0, 0, -6) //前6天
+		beego.BeeLogger.Warn("start:%s",start)
+		//2018-03-10 00:00:00
+		end = queryDateTmp.AddDate(0,0,1)
+		beego.BeeLogger.Warn("end:%s",end)
+
+	}
+
+	subUserCountPerDayList := models.GetAllCowSubUserCountByDay(start, end, true)
+	unSubUserCountPerDayList := models.GetAllCowUnSubUserCountByDay(start,end, true)
+	//subOtherCountPerDayList := models.GetSubOtherCountByDay(start, end)
+	//unSubOtherCountPerDayList := models.GetUnSubOtherCountByDay(start, end)
+
+	var days []string
+	var dayNewFans []int64
+	var dayNetFans []int64
+
+
+	for i := 0; i < 7; i++ {
+
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+
+		md := start.AddDate(0, 0, i).Format("20060102")
+
+		mdInt,_ := strconv.ParseInt(md, 0 ,64)
+		beego.BeeLogger.Warn("md:%s,mdint:%d",md,mdInt)
+
+		sub := models.ContainsInDayItemListAndReturnItemCount(mdInt, subUserCountPerDayList)
+		//subOther := ContainsInDayListAndReturn(mdInt, subOtherCountPerDayList)
+		unSub := models.ContainsInDayItemListAndReturnItemCount(mdInt, unSubUserCountPerDayList)
+		//unSubOther := ContainsInDayListAndReturn(mdInt, unSubOtherCountPerDayList)
+
+		//subOtherNet := subOther - unSubOther
+
+
+		dayNewF :=  sub
+		beego.BeeLogger.Warn("dayNewF:%d", dayNewF)
+
+		dayNewFans = append(dayNewFans, dayNewF)
+
+		dayNetF := sub - unSub
+		beego.BeeLogger.Warn("dayNetF:%d", dayNetF)
+
+		dayNetFans = append(dayNetFans, dayNetF)
+	}
+
+	self.Data["json"] = &Ret{Days:days, DayNewFans: dayNewFans,DayNetFans: dayNetFans}
+	self.ServeJSON()
+
+}

+ 64 - 0
go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_month_add.go

@@ -0,0 +1,64 @@
+package cow_fans_controller
+
+import (
+	"strings"
+	"time"
+	"github.com/astaxie/beego"
+	"d5c-statement-api/models"
+)
+
+type FansMonthAddController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 粉丝某月的新增和净增数量,如果没有输入日期,默认查询当月
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *FansMonthAddController) Get(){
+
+	query_date := self.GetString("query_date")
+
+	s := strings.Split(query_date,"-")
+
+	now := time.Now()
+	queryDate := time.Date(now.Year(), now.Month(), 1, 0, 0,0 ,0, time.Local)
+
+	if len(s) == 3 {
+
+		query_date_tmp, _ := time.Parse("2006-01-02",query_date)
+		queryDate = time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0,0 ,0, time.Local)
+
+	}
+	if len(s) == 2 {
+
+		query_date, _ := time.Parse("2006-01",query_date)
+		queryDate = time.Date(query_date.Year(), query_date.Month(), 1, 0, 0,0 ,0, time.Local)
+
+	}
+
+	type Ret struct {
+		QueryDate      string            `json:"query_date"`       //查询日期
+		FansMonthNewAdd  int64           `json:"fans_month_new_add"` //日期下粉丝新增(渠道关注+非渠道关注)
+		FansMonthNetAdd  int64           `json:"fans_month_net_add"` //日期下粉丝净增(渠道关注+非渠道关注-渠道取消关注-非渠道取消关注)
+		CowsMonthNewAdd  int64           `json:"cows_month_new_add"` //日期下养成牛新增
+	}
+
+
+	//某月不分有没有渠道的所有关注人数
+	subUserCount := models.GetAllCowSubUserCount(queryDate, queryDate.AddDate(0,1,0),true)
+
+	//某月不分有没有渠道的所有取消关注人数
+	unSubUserCount := models.GetAllCowUnSubUserCount(queryDate, queryDate.AddDate(0,1,0), true)
+
+	//日期下养成牛总数统计
+	subCowCount := models.GetAllCowOrderCount(queryDate, queryDate.AddDate(0,1,0), true)
+
+	self.Data["json"] = &Ret{QueryDate: queryDate.Format("2006-01"), FansMonthNewAdd: subUserCount, FansMonthNetAdd: subUserCount - unSubUserCount, CowsMonthNewAdd: subCowCount}
+
+	self.ServeJSON()
+
+}
+

+ 99 - 0
go/gopath/src/d5c-statement-api/controllers/cow_fans_controller/fans_month_grouth.go

@@ -0,0 +1,99 @@
+package cow_fans_controller
+
+import (
+	"github.com/astaxie/beego"
+	"strings"
+	"time"
+	"d5c-statement-api/models"
+	"strconv"
+)
+
+type FansMonthGrouthController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 默认是当月及其前5月,输入某个日期,查询输入日期月份及其前5月的净增和新增数组
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *FansMonthGrouthController) Get(){
+
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date,"-")
+	type Ret struct {
+		Months                []string `json:"months"`             //六个月
+		MonthNewFans          []int64  `json:"month_new_fans"`     //新增
+		MonthNetFans          []int64  `json:"month_net_fans"`     //净增
+	}
+
+	now := time.Now()//2018-03-24 14:32:00
+	start := now
+	end := now
+
+	query_date_tmp := now
+	if len(s) == 3 {
+		//2018-02-09 00:00:00
+		query_date_tmp, _ = time.Parse("2006-01-02", query_date)
+	}
+	if len(s) == 2 {
+		//2018-02-01 00:00:00
+		query_date_tmp, _ = time.Parse("2006-01", query_date)
+	}
+
+	//2018-02-01 00:00:00
+	queryDate := time.Date(query_date_tmp.Year(),query_date_tmp.Month(),1,0,0,0,0,time.Local)
+
+	start = queryDate.AddDate(0, -5, 0) //2018-09-01 00:00:00
+	beego.BeeLogger.Warn("start:%s",start)
+
+	end = queryDate.AddDate(0,1,0)//2018-03-01 00:00:00
+	beego.BeeLogger.Warn("end:%s",end)
+
+
+	subUserCountPerMonthList := models.GetAllCowSubUserCountByMonth(start, end, true)
+	unSubUserCountPerMonthList := models.GetAllCowUnSubUserCountByMonth(start,end, true)
+	//subOtherCountPerMonthList := models.GetSubOtherCountByMonth(start, end)
+	//unSubOtherCountPerMonthList := models.GetUnSubOtherCountByMonth(start, end)
+
+	var months []string
+	var monthNewFans []int64
+	var monthNetFans []int64
+
+
+	for i := 0; i < 6; i++ {
+
+		month := start.AddDate(0, i, 0).Format("2006-01")
+		months = append(months, month)
+
+		ym := start.AddDate(0, i, 0).Format("200601")
+
+		ymInt,_ := strconv.ParseInt(ym, 0 ,64)
+
+		sub := models.ContainsInMonthItemListAndReturnItemCount(ymInt, subUserCountPerMonthList)
+		beego.BeeLogger.Warn("sub:%d",sub)
+		//subOther := ContainsInMonthListAndReturn(ymInt, subOtherCountPerMonthList)
+		//beego.BeeLogger.Warn("subOther:%d",subOther)
+		unSub := models.ContainsInMonthItemListAndReturnItemCount(ymInt, unSubUserCountPerMonthList)
+		beego.BeeLogger.Warn("unSub:%d",unSub)
+		//unSubOther := ContainsInMonthListAndReturn(ymInt, unSubOtherCountPerMonthList)
+		//beego.BeeLogger.Warn("unSubOther:%d",unSubOther)
+
+		//subOtherNet := subOther - unSubOther
+
+
+		dayNewF :=  sub
+		beego.BeeLogger.Warn("monthNewF:%d", dayNewF)
+
+		monthNewFans = append(monthNewFans, dayNewF)
+
+		dayNetF := sub - unSub
+		beego.BeeLogger.Warn("monthNetF:%d", dayNetF)
+
+		monthNetFans = append(monthNetFans, dayNetF)
+	}
+
+	self.Data["json"] = &Ret{Months: months, MonthNewFans: monthNewFans, MonthNetFans: monthNetFans}
+	self.ServeJSON()
+}

+ 95 - 0
go/gopath/src/d5c-statement-api/controllers/cow_point_task/cow_point_task.go

@@ -0,0 +1,95 @@
+package cow_point_task
+
+import (
+	"fmt"
+	"time"
+
+	"d5c-statement-api/models"
+	// "d5c-statement-api/tools"
+	"github.com/astaxie/beego"
+)
+
+//养牛任务相关
+type CowPointTaskController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description daily signin : 每日任务报表-日统计
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Success 200 {object} int64
+// @router /signin/daily [get]
+func (self *CowPointTaskController) SigninDaily() {
+	//月份
+	_month := self.GetString("query_date")
+	month, _ := time.Parse("2006-01", _month)
+	monthFirstDay := time.Date(month.Year(), month.Month(), 1, 0, 0, 0, 0, time.Now().Location())
+	//该月最后一天
+	monthLastDay := monthFirstDay.AddDate(0, 1, -1)
+	// beego.BeeLogger.Warn("lastday:%v", monthLastDay)
+	list := models.GetCowDailySigninByDate(monthLastDay)
+	type Ret struct {
+		Days   []string `json:"days"`  //天数
+		Counts []int64  `json:"count"` //任务人数
+	}
+	days, counts := []string{}, []int64{}
+	for _, item := range list {
+		signDate := time.Unix(item.SignDate, 0)
+		signDateStr := fmt.Sprintf("%02d-%02d", signDate.Month(), signDate.Day())
+		days = append(days, signDateStr)
+		counts = append(counts, item.Count)
+	}
+	self.Data["json"] = &Ret{Days: days, Counts: counts}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description daily signin : 每日任务报表-月统计
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Success 200 {object} int64
+// @router /signin/monthly [get]
+func (self *CowPointTaskController) SigninMonthly() {
+}
+
+// @Title Get
+// @Description daily signin : 已完成任务-日统计
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Success 200 {object} int64
+// @router /finished/daily [get]
+func (self *CowPointTaskController) FinishedTaskDaily() {
+	//月份
+	_month := self.GetString("query_date")
+	month, _ := time.Parse("2006-01", _month)
+	monthFirstDay := time.Date(month.Year(), month.Month(), 1, 0, 0, 0, 0, time.Now().Location())
+	//下个月第一天
+	nextMonthFirstDay := monthFirstDay.AddDate(0, 1, 0)
+	monthStartUnix := monthFirstDay.Unix()
+	nextMonthStartUnix := nextMonthFirstDay.Unix()
+
+	//tags := []string{"daily_continuity", "daily_countdown", "daily_interval", "daily_article", "daily_share"}
+	type Ret struct {
+		Days        []string `json:"days"`       //天数
+		Continuity         []int64  `json:"daily_continuity"`        //每日签到
+		CountDown      []int64  `json:"daily_countdown"`     //倒计时签到
+		Interval []int64  `json:"daily_interval"`    //分时段签到
+		Article    []int64  `json:"daily_article"`   //阅读文章
+		Share    []int64  `json:"share"`   //分享好友
+		Vedio    []int64  `json:"vedio"`   //观看视频
+		Gap    []int64  `json:"gap"`   //间接喂养
+	}
+	days, continuity, countdown, interval, article, share, vedio, gap := []string{}, []int64{}, []int64{}, []int64{}, []int64{}, []int64{}, []int64{}, []int64{}
+	for i, j := monthStartUnix, 1; i < nextMonthStartUnix; i, j = i+24*3600, j+1 {
+		day := fmt.Sprintf("%02d-%02d", monthFirstDay.Month(), j)
+		days = append(days, day)
+		_continuity, _countdown, _interval, _article, _share, _vedio, _gap := models.GetCowFinishedTasksByDate(i)
+		continuity = append(continuity, _continuity.Count)
+		countdown = append(countdown, _countdown.Count)
+		interval = append(interval, _interval.Count)
+		article = append(article, _article.Count)
+		share = append(share, _share.Count)
+		vedio = append(vedio, _vedio.Count)
+		gap = append(gap, _gap.Count)
+	}
+	self.Data["json"] = &Ret{Days: days, Continuity: continuity, CountDown: countdown, Article: article, Interval: interval, Share: share, Vedio: vedio, Gap: gap}
+	self.ServeJSON()
+}

+ 254 - 0
go/gopath/src/d5c-statement-api/controllers/cow_point_task/d5c_prize_record.go

@@ -0,0 +1,254 @@
+package cow_point_task
+
+import (
+	"d5c-statement-api/models"
+	"github.com/astaxie/beego"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// @Title Get
+// @Description 第五创积分抽奖 - 输入某个日期(默认是今天及其前6天),查询输入日期及其前6天的统计数据
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /d5c_daily_prize/seven [get]
+func (self *GamePrizeDailyController) D5cPrizeRecordCountSeven() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type CountList struct {
+		ConfigId   int64             `json:"config_id"`   //配置ID
+		ConfigName string            `json:"config_name"` //配置名称
+		CountData  []*models.DayItem `json:"count_data"`  //统计数据
+		CountDay   []int64           `json:"count_day"`   //按天的统计数据
+	}
+	type Ret struct {
+		Days        []string     `json:"days"`         //最近7天
+		PrizeConfig []*CountList `json:"prize_config"` //按照奖品配置列表进行统计
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+	startTime := now.AddDate(0, 0, -6)
+	nextTime := now.AddDate(0, 0, 1)
+
+	start := time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 0, 0, 0, 0, time.Local)
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(), 0, 0, 0, 0, time.Local)
+
+	if len(s) == 3 {
+		//2006-01-02 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(), 0, 0, 0, 0, time.Local)
+
+		start = queryDateTmp.AddDate(0, 0, -6) //前6天
+		beego.BeeLogger.Warn("start:%s", start)
+
+		end = queryDateTmp.AddDate(0, 0, 1)
+		beego.BeeLogger.Warn("end:%s", end)
+
+	}
+
+	c := "type_d5c" //第五创平台
+	pConfigList := models.GetPrizeDrawList(c)
+	var prizeDataList []*CountList
+	for _, item := range pConfigList {
+		countOne := new(CountList)
+		list := models.D5cGameRecordCountByTime(item.Id, start, end)
+		countOne.ConfigId = item.Id
+		countOne.ConfigName = item.Name
+		countOne.CountData = list
+
+		var dayCountData []int64
+		for i := 0; i < 7; i++ {
+			md := start.AddDate(0, 0, i).Format("20060102")
+			mdInt, _ := strconv.ParseInt(md, 0, 64)
+			dayCashOrderCount := models.CashDayItemListAndReturnItemCount(mdInt, list)
+			dayCountData = append(dayCountData, dayCashOrderCount)
+		}
+		countOne.CountDay = dayCountData
+
+		prizeDataList = append(prizeDataList, countOne)
+	}
+
+	var days []string
+	for i := 0; i < 7; i++ {
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Days: days, PrizeConfig: prizeDataList}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 第五创积分抽奖 - 输入某个日期,获得天天抽奖的:每日参与总人数、每日积分消耗总数
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /d5c_daily_prize/countuser [get]
+func (self *GamePrizeDailyController) D5cRecordCountUserOneDay() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type Ret struct {
+		Day       string `json:"day"`        //日期
+		CountUser int64  `json:"count_user"` //参与总人数
+		CountFeed int64  `json:"count_feed"` //积分消耗总数
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+
+	start := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
+	end := start.AddDate(0, 0, 1)
+
+	if len(s) == 3 {
+		//2006-01-02 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(), 0, 0, 0, 0, time.Local)
+
+		start = queryDateTmp
+		beego.BeeLogger.Warn("start:%s", start)
+
+		end = queryDateTmp.AddDate(0, 0, 1)
+		beego.BeeLogger.Warn("end:%s", end)
+	}
+
+	countUser := models.D5cGameRecordUserCountByTime(-1, start, end)
+	countFeed := models.D5cGameRecordFeedReduceCountByTime(start, end)
+
+	var days []string
+	for i := 0; i < 7; i++ {
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Day: start.Format("2006-01-02"), CountUser: countUser, CountFeed: countFeed}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 第五创积分抽奖 - 按月统计数据 - 六个月的数据
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /d5c_month_prize/count [get]
+func (self *GamePrizeDailyController) D5cRecordCountHalfYear() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type CountList struct {
+		ConfigId   int64               `json:"config_id"`   //配置ID
+		ConfigName string              `json:"config_name"` //配置名称
+		CountData  []*models.MonthItem `json:"count_data"`  //统计数据
+		CountDay   []int64             `json:"count_day"`   //按月的统计数据
+	}
+	type Ret struct {
+		Months      []string     `json:"days"`         //最近六个月
+		PrizeConfig []*CountList `json:"prize_config"` //按照奖品配置列表进行统计
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+	startTime := now.AddDate(0, -5, 0)
+	nextTime := now.AddDate(0, 1, 0)
+
+	start := time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 0, 0, 0, 0, time.Local)
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(), 0, 0, 0, 0, time.Local)
+
+	query_date_tmp := now
+	if len(s) == 3 {
+		query_date_tmp, _ = time.Parse("2006-01-02", query_date)
+		queryDate := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+		start = queryDate.AddDate(0, -5, 0)
+		end = queryDate.AddDate(0, 1, 0)
+	}
+	if len(s) == 2 {
+		query_date_tmp, _ = time.Parse("2006-01", query_date)
+		queryDate := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+		start = queryDate.AddDate(0, -5, 0)
+		end = queryDate.AddDate(0, 1, 0)
+	}
+
+	c := "type_d5c" //第五创平台
+	pConfigList := models.GetPrizeDrawList(c)
+	var prizeDataList []*CountList
+	for _, item := range pConfigList {
+		countOne := new(CountList)
+		list := models.D5cGameRecordCountByMonth(item.Id, start, end)
+		countOne.ConfigId = item.Id
+		countOne.ConfigName = item.Name
+		countOne.CountData = list
+
+		var dayCountData []int64
+		for i := 0; i < 6; i++ {
+			md := start.AddDate(0, i, 0).Format("200601")
+			mdInt, _ := strconv.ParseInt(md, 0, 64)
+			dayCashOrderCount := models.ContainsInMonthItemListAndReturnItemCount(mdInt, list)
+			dayCountData = append(dayCountData, dayCashOrderCount)
+		}
+		countOne.CountDay = dayCountData
+
+		prizeDataList = append(prizeDataList, countOne)
+	}
+
+	var days []string
+	for i := 0; i < 6; i++ {
+		day := start.AddDate(0, i, 0).Format("2006-01")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Months: days, PrizeConfig: prizeDataList}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 第五创积分抽奖 - 按月统计数据,获得天天抽奖的:每月参与总人数、每月积分消耗总数
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /d5c_month_prize/countuser [get]
+func (self *GamePrizeDailyController) D5cRecordCountUserOneMonth() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type Ret struct {
+		Month     string `json:"month"`      //日期
+		CountUser int64  `json:"count_user"` //参与总人数
+		CountFeed int64  `json:"count_feed"` //积分消耗总数
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+
+	start := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, time.Local)
+	end := start.AddDate(0, 1, 0)
+
+	if len(s) == 3 {
+		//2006-01-02 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+
+		start = queryDateTmp
+		beego.BeeLogger.Warn("start:%s", start)
+
+		end = queryDateTmp.AddDate(0, 1, 0)
+		beego.BeeLogger.Warn("end:%s", end)
+	}
+	if len(s) == 2 {
+		query_date_tmp, _ := time.Parse("2006-01", query_date)
+		queryDate := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+		start = queryDate
+		end = queryDate.AddDate(0, 1, 0)
+	}
+
+	countUser := models.D5cGameRecordUserCountByTime(-1, start, end)
+	countFeed := models.D5cGameRecordFeedReduceCountByTime(start, end)
+
+	var days []string
+	for i := 0; i < 7; i++ {
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Month: start.Format("2006-01"), CountUser: countUser, CountFeed: countFeed}
+	self.ServeJSON()
+}

+ 271 - 0
go/gopath/src/d5c-statement-api/controllers/cow_point_task/daily_game_record.go

@@ -0,0 +1,271 @@
+package cow_point_task
+
+import (
+	"d5c-statement-api/models"
+	"github.com/astaxie/beego"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type GamePrizeDailyController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 获取养牛平台的抽奖奖品配置列表
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /prize/config [get]
+func (self *GamePrizeDailyController) PrizeDrawConfig() {
+	c := "type_cow" //养牛平台
+	list := models.GetPrizeDrawList(c)
+	self.Data["json"] = list
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 输入某个日期(默认是今天及其前6天),查询输入日期及其前6天的统计数据
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /daily_prize/seven [get]
+func (self *GamePrizeDailyController) RecordDailyCountSeven() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type CountList struct {
+		ConfigId   int64             `json:"config_id"`   //配置ID
+		ConfigName string            `json:"config_name"` //配置名称
+		CountData  []*models.DayItem `json:"count_data"`  //统计数据
+		CountDay   []int64           `json:"count_day"`   //按天的统计数据
+	}
+	type Ret struct {
+		Days        []string     `json:"days"`         //最近7天
+		PrizeConfig []*CountList `json:"prize_config"` //按照奖品配置列表进行统计
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+	startTime := now.AddDate(0, 0, -6)
+	nextTime := now.AddDate(0, 0, 1)
+
+	start := time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 0, 0, 0, 0, time.Local)
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(), 0, 0, 0, 0, time.Local)
+
+	if len(s) == 3 {
+		//2006-01-02 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(), 0, 0, 0, 0, time.Local)
+
+		start = queryDateTmp.AddDate(0, 0, -6) //前6天
+		beego.BeeLogger.Warn("start:%s", start)
+
+		end = queryDateTmp.AddDate(0, 0, 1)
+		beego.BeeLogger.Warn("end:%s", end)
+
+	}
+
+	c := "type_cow" //养牛平台
+	pConfigList := models.GetPrizeDrawList(c)
+	var prizeDataList []*CountList
+	for _, item := range pConfigList {
+		countOne := new(CountList)
+		list := models.GameRecordCountByTime(item.Id, start, end)
+		countOne.ConfigId = item.Id
+		countOne.ConfigName = item.Name
+		countOne.CountData = list
+
+		var dayCountData []int64
+		for i := 0; i < 7; i++ {
+			md := start.AddDate(0, 0, i).Format("20060102")
+			mdInt, _ := strconv.ParseInt(md, 0, 64)
+			dayCashOrderCount := models.CashDayItemListAndReturnItemCount(mdInt, list)
+			dayCountData = append(dayCountData, dayCashOrderCount)
+		}
+		countOne.CountDay = dayCountData
+
+		prizeDataList = append(prizeDataList, countOne)
+	}
+
+	var days []string
+	for i := 0; i < 7; i++ {
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Days: days, PrizeConfig: prizeDataList}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 输入某个日期,获得天天抽奖的:每日参与总人数、每日饲料消耗总数
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /daily_prize/countuser [get]
+func (self *GamePrizeDailyController) RecordCountUserOneDay() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type Ret struct {
+		Day       string `json:"day"`        //日期
+		CountUser int64  `json:"count_user"` //参与总人数
+		CountFeed int64  `json:"count_feed"` //饲料消耗总数
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+
+	start := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
+	end := start.AddDate(0, 0, 1)
+
+	if len(s) == 3 {
+		//2006-01-02 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(), 0, 0, 0, 0, time.Local)
+
+		start = queryDateTmp
+		beego.BeeLogger.Warn("start:%s", start)
+
+		end = queryDateTmp.AddDate(0, 0, 1)
+		beego.BeeLogger.Warn("end:%s", end)
+	}
+
+	countUser := models.GameRecordUserCountByTime(-1, start, end)
+	countFeed := models.GameRecordFeedReduceCountByTime(start, end)
+
+	var days []string
+	for i := 0; i < 7; i++ {
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Day: start.Format("2006-01-02"), CountUser: countUser, CountFeed: countFeed}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 按月统计数据 - 六个月的数据
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /month_prize/count [get]
+func (self *GamePrizeDailyController) RecordCountHalfYear() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type CountList struct {
+		ConfigId   int64               `json:"config_id"`   //配置ID
+		ConfigName string              `json:"config_name"` //配置名称
+		CountData  []*models.MonthItem `json:"count_data"`  //统计数据
+		CountDay   []int64             `json:"count_day"`   //按月的统计数据
+	}
+	type Ret struct {
+		Months      []string     `json:"days"`         //最近六个月
+		PrizeConfig []*CountList `json:"prize_config"` //按照奖品配置列表进行统计
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+	startTime := now.AddDate(0, -5, 0)
+	nextTime := now.AddDate(0, 1, 0)
+
+	start := time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 0, 0, 0, 0, time.Local)
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(), 0, 0, 0, 0, time.Local)
+
+	query_date_tmp := now
+	if len(s) == 3 {
+		query_date_tmp, _ = time.Parse("2006-01-02", query_date)
+		queryDate := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+		start = queryDate.AddDate(0, -5, 0)
+		end = queryDate.AddDate(0, 1, 0)
+	}
+	if len(s) == 2 {
+		query_date_tmp, _ = time.Parse("2006-01", query_date)
+		queryDate := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+		start = queryDate.AddDate(0, -5, 0)
+		end = queryDate.AddDate(0, 1, 0)
+	}
+
+	c := "type_cow" //养牛平台
+	pConfigList := models.GetPrizeDrawList(c)
+	var prizeDataList []*CountList
+	for _, item := range pConfigList {
+		countOne := new(CountList)
+		list := models.GameRecordCountByMonth(item.Id, start, end)
+		countOne.ConfigId = item.Id
+		countOne.ConfigName = item.Name
+		countOne.CountData = list
+
+		var dayCountData []int64
+		for i := 0; i < 6; i++ {
+			md := start.AddDate(0, i, 0).Format("200601")
+			mdInt, _ := strconv.ParseInt(md, 0, 64)
+			dayCashOrderCount := models.ContainsInMonthItemListAndReturnItemCount(mdInt, list)
+			dayCountData = append(dayCountData, dayCashOrderCount)
+		}
+		countOne.CountDay = dayCountData
+
+		prizeDataList = append(prizeDataList, countOne)
+	}
+
+	var days []string
+	for i := 0; i < 6; i++ {
+		day := start.AddDate(0, i, 0).Format("2006-01")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Months: days, PrizeConfig: prizeDataList}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 按月统计数据,获得天天抽奖的:每月参与总人数、每月饲料消耗总数
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /month_prize/countuser [get]
+func (self *GamePrizeDailyController) RecordCountUserOneMonth() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+
+	type Ret struct {
+		Month     string `json:"month"`      //日期
+		CountUser int64  `json:"count_user"` //参与总人数
+		CountFeed int64  `json:"count_feed"` //饲料消耗总数
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+
+	start := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, time.Local)
+	end := start.AddDate(0, 1, 0)
+
+	if len(s) == 3 {
+		//2006-01-02 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+
+		start = queryDateTmp
+		beego.BeeLogger.Warn("start:%s", start)
+
+		end = queryDateTmp.AddDate(0, 1, 0)
+		beego.BeeLogger.Warn("end:%s", end)
+	}
+	if len(s) == 2 {
+		query_date_tmp, _ := time.Parse("2006-01", query_date)
+		queryDate := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+		start = queryDate
+		end = queryDate.AddDate(0, 1, 0)
+	}
+
+	countUser := models.GameRecordUserCountByTime(-1, start, end)
+	countFeed := models.GameRecordFeedReduceCountByTime(start, end)
+
+	var days []string
+	for i := 0; i < 7; i++ {
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+	}
+
+	self.Data["json"] = &Ret{Month: start.Format("2006-01"), CountUser: countUser, CountFeed: countFeed}
+	self.ServeJSON()
+}

+ 144 - 0
go/gopath/src/d5c-statement-api/controllers/cow_punch/cow_punch.go

@@ -0,0 +1,144 @@
+package cow_punch
+
+import (
+	"time"
+
+	"d5c-statement-api/models"
+	// "d5c-statement-api/tools"
+	"github.com/astaxie/beego"
+	"strconv"
+
+)
+
+//养牛任务相关
+type CowPunchController struct {
+	beego.Controller
+}
+
+type Ret struct {
+	Times                       []string   `json:"times"`                      //12个月/30天/24小时
+	DayTotal                    int64    `json:"day_total"`                //当天报名人数
+	DayPunchTotal               []int64   `json:"day_punch_total"`             //当天报名总额
+}
+
+// @Title Get
+// @Description get 牛就对了平台新增报名中心数据:type:m/d/y,m是月天数统计,d是日小时统计,y是年12月统计,query_date格式:YYYY-MM-DD,query_month 格式:YYYY-MM
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Param	type	query	string	false	"type"
+// @Param	query_month	query	string	false	"query_month"
+// @Success 200 {object} Ret
+// @router / [get]
+func (self *CowPunchController) Get(){
+
+	query_date := self.GetString("query_date")
+	query_month := self.GetString("query_month")
+
+	query_type := self.GetString("type")
+	now := time.Now()
+
+	queryDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
+	queryCurrentDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
+	queryEndDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
+	queryNextDate := queryDate.AddDate(0, 0, 1)
+
+	query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+	query_date_month, _ := time.Parse("2006-01", query_month)
+	if query_type == "d" {
+		//查询一个月份30天
+		queryCurrentDate = time.Date(query_date_tmp.Year(), query_date_tmp.Month(),query_date_tmp.Day(), 0, 0, 0, 0, time.Local)
+		queryEndDate = queryCurrentDate.AddDate(0, 0, 1)
+		queryDate = time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0, 0, 0, time.Local)
+		queryNextDate = queryDate.AddDate(0, 1, 0)
+	} else {
+		queryDateTmp := time.Date(query_date_month.Year(), query_date_month.Month(), 1, 0, 0, 0, 0, time.Local)
+		queryCurrentDate = queryDateTmp
+		queryEndDate = queryCurrentDate.AddDate(0, 1, 0)
+		queryDate = queryDateTmp.AddDate(0, -12, 0)
+		queryNextDate = queryDateTmp.AddDate(0, 1, 0)
+	}
+
+	//--------------------------------------------数据处理
+	beego.BeeLogger.Warn("queryDate queryNextDate (%s,%s)",queryDate.Format("2006-01-02"),queryNextDate.Format("2006-01-02"))
+	//---------------------------------------------Times数据处理
+
+	if query_type == "d"{
+		//2019-05-01 00:00:00  --- 2019-06-01 00:00:00
+		self.QueryByDayOnDay(queryDate,queryNextDate,queryCurrentDate,queryEndDate)
+	}
+}
+
+func (self *CowPunchController) QueryByDayOnDay(queryDate, queryNextDate ,queryCurrentDate,queryEndDate  time.Time){
+
+	var times []string
+	var DayStockTotal []int64
+
+	dayTotal := models.GetPunchCount(queryCurrentDate, queryEndDate, false)
+	dayTimeStockTotal := models.GetAllPunchTotalByDay(queryDate, queryNextDate,false)
+
+
+	for i := 0; i < queryNextDate.AddDate(0,0,-1).Day(); i++ {
+
+		increaseDate := queryDate.AddDate(0,0,i).Format("01-02")
+		times = append(times, increaseDate)
+
+		findDate := queryDate.AddDate(0,0,i).Format("20060102")
+		findDateInt,_ := strconv.ParseInt(findDate, 0, 64)
+
+
+		//打卡报名每日总数
+		totalSub := models.ContainsInDayPunchItemListStockTransferCount(findDateInt, dayTimeStockTotal)
+		DayStockTotal = append(DayStockTotal, totalSub)
+
+	}
+
+	self.Data["json"] = Ret{
+		Times                      :times,
+		DayTotal                   :dayTotal,
+		DayPunchTotal        	   :DayStockTotal,
+	}
+	//beego.BeeLogger.Warn("-------%v",self.Data["json"])
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description punch count : 每日任务报表-日统计
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Success 200 {object} Ret
+// @router /punch/count [get]
+func (self *CowPunchController) SigninDaily() {
+	type Ret struct {
+		List       []*models.CowPunchDt             `json:"list"`
+	}
+	userPunchs:= models.GetCowPunchDtByDate()
+	
+	ret := new(Ret)
+	ret.List = userPunchs
+	self.Data["json"] = ret
+	self.ServeJSON()
+}
+
+
+// @Title Get
+// @Description punch count : 每日养牛报表-日统计
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Success 200 {object} Ret
+// @router /cow/count [get]
+func (self *CowPunchController) CowStateDaily() {
+	type Ret struct {
+		List       []*models.CowsDt             `json:"list"`
+	}
+	userCows:= models.GetCowDtByRank()
+
+	ret := new(Ret)
+	ret.List = userCows
+	self.Data["json"] = ret
+	self.ServeJSON()
+}
+
+
+
+
+
+
+

+ 293 - 0
go/gopath/src/d5c-statement-api/controllers/d5c_article_controller/article_stat.go

@@ -0,0 +1,293 @@
+package d5c_article_controller
+
+import (
+	"github.com/astaxie/beego"
+	"d5c-statement-api/models"
+	"fmt"
+	"time"
+	"strconv"
+	"d5c-statement-api/tools"
+)
+
+type ArticleStatController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 文章模块 : 文章统计,下拉文章选择框,文章的发布时间,文章的阅读量
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	page	query	int64	false	"page"
+// @Param	per_page	query	int64	false	"per_page"
+// @Param	query_title	query	string	false	"query_title"
+// @Success 200 {object} Ret
+// @router /list [get]
+func (self *ArticleStatController) GetArticle() {
+
+	page, _ := self.GetInt64("page")
+	perPage, _ := self.GetInt64("per_page")
+	if page > 0 && perPage > 20 {
+		perPage = 20
+	}
+	queryTitle := self.GetString("query_title")
+
+	type Ret struct {
+		List []*models.D5cArticle `json:"list"`
+	}
+
+	list := models.GetD5cArticle(queryTitle, page, perPage)
+	for _,item := range list{
+		item.PTime = item.PulishTime.Unix()
+	}
+
+	self.Data["json"] = &Ret{List: list}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 文章模块 : 阅读人数、积分发放、分享好友次数、分享朋友圈次数
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	article_id	path	int64	true	"article_id"
+// @Success 200 {object} Ret
+// @Failure 404 :article_id is empty || article not found
+// @Failure 403 :for owner only
+// @router /:article_id/data/count [get]
+func (self *ArticleStatController) GetArticleCount() {
+
+	aId, _ := self.GetInt64(":article_id")
+
+	type Ret struct {
+		ReadCount       int64 `json:"read_count"`
+		BalanceGiveout  int64 `json:"balance_give_out"`
+		ShareToGroup    int64 `json:"share_to_group"`
+		ShareToTimeline int64 `json:"share_to_timeline"`
+	}
+
+	readCount := models.GetReadWxUserCountByAId(aId)
+	balanceA := models.GetPmBalanceCountByAId(aId)
+	balanceB := models.GetPmWxUserBalanceCountByAId(aId)
+
+	shareToGroup := models.GetShareToGroupCountByAId(aId)
+	shareToTimeline := models.GetShareToTimelineCountByAId(aId)
+
+	self.Data["json"] = &Ret{ReadCount: readCount, BalanceGiveout: balanceA + balanceB, ShareToGroup: shareToGroup, ShareToTimeline: shareToTimeline}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 文章模块 : 渠道数据
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Success 200 {object} Ret
+// @Failure 404 :article_id is empty || article not found
+// @Failure 403 :for owner only
+// @router /channel_data/count [get]
+func (self *ArticleStatController) GetArticleChannelData() {
+
+	//aId, _ := self.GetInt64(":article_id")
+
+	type Ret struct {
+		List    []*models.DataPerChannelArticle     `json:"list"`
+	}
+
+	var resultList []*models.DataPerChannelArticle
+
+	//处理非渠道
+	noChannelData := models.GetDataNoChannelArticleItem()
+	noChannelRegist := models.GetNoChannelRegistUserCount()
+	noChannelData.RegistCount = noChannelRegist.TotalCount
+
+	if noChannelRegist.TotalCount >0 {
+		beego.BeeLogger.Warn("aaaaaaaaaaaaaaa%d",noChannelRegist.TotalCount)
+		noChannelData.ActiveRate = fmt.Sprintf("%0.2f%s",tools.RoundFloat64((float64(noChannelData.Count)/float64(noChannelRegist.TotalCount))*100,2),"%")
+	}else{
+		noChannelData.ActiveRate = fmt.Sprintf("%0.2f%s",float64(0),"%")
+	}
+	resultList = append(resultList, noChannelData)
+
+	//处理有渠道
+	channelList := models.GetDataPerChannelArticleList()
+	channelRegist := models.GetPerChannelRegistUserCountList()
+	for _,item:= range channelList {
+		tmp := models.ContainInDataPerChannelListAndReturnTotalCount(item.SignupChannelId, channelRegist)
+		noChannelData.RegistCount = tmp
+		if tmp > 0 {
+			beego.BeeLogger.Warn("aaaaaaaaaaaaaaaa%d",tmp)
+			item.ActiveRate = fmt.Sprintf("%0.2f%s",tools.RoundFloat64((float64(item.Count)/float64(tmp))*100,2),"%")
+		}else{
+			item.ActiveRate = fmt.Sprintf("%0.2f%s",float64(0),"%")
+		}
+
+		resultList = append(resultList, item)
+
+	}
+
+	self.Data["json"] = &Ret{List:resultList}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 文章模块 : 文章的阅读人数:发布一天内阅读人数量是多少
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	article_id	path	int64	true	"article_id"
+// @Success 200 {object} Ret
+// @Failure 404 :article_id is empty || article not found
+// @Failure 403 :for owner only
+// @router /:article_id/read_count/grouth [get]
+func (self *ArticleStatController) GetArticleReadCountGrouth() {
+
+	aId, _ := self.GetInt64(":article_id")
+
+	type Ret struct {
+		Times   []string                            `json:"times"`
+		Count   []int64                             `json:"count"`
+	}
+	//list := models.GetClickGrouthByAId(aId)
+	list := models.GetReadWxUserCountGrouthByAId(aId)
+
+	var times []string
+	var count []int64
+	for i:=0; i< 8 ;i++  {
+		times = append(times, fmt.Sprintf("%d天",i))
+
+		tmp := models.ContainsInClickItemAndReturnItemCount(int64(i), list)
+
+		count = append(count, tmp)
+
+	}
+
+	self.Data["json"] = &Ret{Times:times, Count:count}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 文章每月 : 该月被阅读的所有文章数据列表,以及该月的总阅读量和阅读人数
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	true	"query_date"
+// @Success 200 {object} Ret
+// @Failure 403 :for owner only
+// @router /monthly/data/list [get]
+func (self *ArticleStatController) GetMonthlyArticleDataList() {
+
+	query_date := self.GetString("query_date")
+
+	now := time.Now()
+	queryDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0,0 ,0, time.Local)
+	queryNextDate := queryDate.AddDate(0,1,0)
+
+	query_date_tmp,_ := time.Parse("2006-01-02", query_date)
+
+	queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0,0 ,0, time.Local)
+	queryDate = queryDateTmp
+	queryNextDate = queryDateTmp.AddDate(0,1,0)
+
+	type Ret struct {
+		List    []*models.D5cArticle     `json:"list"`
+		TotalClick   int64               `json:"total_click"`
+		TotalUser    int64               `json:"total_user"`
+	}
+
+	list := models.GetD5cArticleList(queryDate, queryNextDate)
+	totalClick := int64(0)
+	totalUser := int64(0)
+
+	for _,item := range list{
+		totalClick += item.ClickNum
+		totalUser += item.Count
+	}
+
+
+	self.Data["json"] = &Ret{List:list, TotalClick:totalClick, TotalUser:totalUser}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 文章每月 : 该月被阅读的所有文章数据列表,以及该月的总阅读量和阅读人数
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	true	"query_date"
+// @Success 200 {object} Ret
+// @Failure 403 :for owner only
+// @router /monthly/data/count [get]
+func (self *ArticleStatController) GetMonthlyArticleDataCount() {
+
+	query_date := self.GetString("query_date")
+
+	now := time.Now()
+	queryDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0,0 ,0, time.Local)
+	queryNextDate := queryDate.AddDate(0,1,0)
+
+	query_date_tmp,_ := time.Parse("2006-01-02", query_date)
+
+	queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0,0 ,0, time.Local)
+	queryDate = queryDateTmp
+	queryNextDate = queryDateTmp.AddDate(0,1,0)
+
+	type Ret struct {
+		MonthlyBalanceGiveout  int64 `json:"monthly_balance_give_out"`
+		MonthlyShareToGroup    int64 `json:"monthly_share_to_group"`
+		MonthlyShareToTimeline int64 `json:"monthly_share_to_timeline"`
+	}
+
+	balanceA := models.GetPmBalanceCountByTime(queryDate,queryNextDate)
+	balanceB := models.GetPmWxUserBalanceCountByTime(queryDate, queryNextDate)
+
+	shareToGroup := models.GetShareToGroupCountByTime(queryDate, queryNextDate)
+	shareToTimeline := models.GetShareToTimelineCountByTime(queryDate, queryNextDate)
+
+	self.Data["json"] = &Ret{MonthlyBalanceGiveout:balanceB+balanceA, MonthlyShareToGroup:shareToGroup, MonthlyShareToTimeline:shareToTimeline}
+	self.ServeJSON()
+}
+
+
+// @Title Get
+// @Description 文章每月 : 阅读人数折线图
+// @Param Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	true	"query_date"
+// @Success 200 {object} Ret
+// @Failure 403 :for owner only
+// @router /monthly/data/grouth [get]
+func (self *ArticleStatController) GetMonthlyArticleDataGrouth() {
+
+	query_date := self.GetString("query_date")
+
+	now := time.Now()
+	queryDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0,0 ,0, time.Local)
+	queryNextDate := queryDate.AddDate(0,1,0)
+
+	query_date_tmp,_ := time.Parse("2006-01-02", query_date)
+
+	queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), 1, 0, 0,0 ,0, time.Local)
+	queryDate = queryDateTmp
+	queryNextDate = queryDateTmp.AddDate(0,1,0)
+
+	type Ret struct {
+		Times     []string              `json:"times"`
+		List      []int64               `json:"list"`
+	}
+
+	var times []string
+	var resultList []int64
+
+	list := models.GetArticleReadUserCountByTime(queryDate, queryNextDate)
+
+	for i:=0; i<queryNextDate.AddDate(0,0,-1).Day();i++ {
+
+		increaseDate := queryDate.AddDate(0, 0, i).Format("01-02")
+		times = append(times, increaseDate)
+
+		findDate := queryDate.AddDate(0, 0, i).Format("20060102")
+		findDateInt, _ := strconv.ParseInt(findDate, 0, 64)
+		beego.BeeLogger.Warn("%d", findDateInt)
+
+		tmp := models.ContainsInDayItemListAndReturnItemCount(findDateInt, list)
+		resultList = append(resultList, tmp)
+	}
+
+	self.Data["json"] = &Ret{List:resultList, Times:times}
+	self.ServeJSON()
+}
+
+
+
+
+
+
+

+ 106 - 0
go/gopath/src/d5c-statement-api/controllers/d5c_bd_cash_order/take_cash_order_day.go

@@ -0,0 +1,106 @@
+package d5c_bd_cash_order
+
+import (
+	"d5c-statement-api/models"
+	"d5c-statement-api/tools"
+	"github.com/astaxie/beego"
+	"strconv"
+	"strings"
+	"time"
+)
+
+type BdCashOrderDayController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description 输入某个日期(默认是今天),查询输入日期当天的提现汇总数据(已打款)
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /count/daily [get]
+func (self *BdCashOrderDayController) BdCashCountDaily() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+	type Ret struct {
+		QueryDate      string  `json:"query_date"`     //查询日期
+		DayBdCashCount float64 `json:"day_cash_count"` //汇总金额
+	}
+
+	now := time.Now()                //2006-01-02 15:04:05
+	nextTime := now.AddDate(0, 0, 1) //2006-01-02 15:04:05
+
+	start := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)              //今天的0点
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(), 0, 0, 0, 0, time.Local) //明天的0点
+
+	if len(s) == 3 {
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		start = time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(), 0, 0, 0, 0, time.Local)
+		beego.BeeLogger.Warn("start:%s", start)
+		end = start.AddDate(0, 0, 1)
+		beego.BeeLogger.Warn("end:%s", end)
+
+	}
+
+	list := models.GetTakeBdCashOrderCountOverByTime(start, end)
+
+	md := start.Format("20060102")
+	mdInt, _ := strconv.ParseInt(md, 0, 64)
+	dayBdCashOrderCount := models.BdCashDayItemListAndReturnItemCount(mdInt, list)
+	dayBdCashOrderCountYuan := tools.RoundFloat64(float64(dayBdCashOrderCount)/float64(100), 2)
+
+	self.Data["json"] = &Ret{QueryDate: start.Format("2006-01-02"), DayBdCashCount: dayBdCashOrderCountYuan}
+	self.ServeJSON()
+}
+
+// @Title Get
+// @Description 输入某个日期(默认是今天及其前6天),查询输入日期及其前6天的提现汇总数据
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Param	query_date	query	string	false	"query_date"
+// @Success 200 {object} Ret
+// @router /count/seven [get]
+func (self *BdCashOrderDayController) BdCashCountSeven() {
+	query_date := self.GetString("query_date")
+	s := strings.Split(query_date, "-")
+	type Ret struct {
+		Days            []string  `json:"days"`            //最近7天
+		BdCashCountList []float64 `json:"cash_count_list"` //汇总金额
+	}
+
+	now := time.Now() //2006-01-02 15:04:05
+	startTime := now.AddDate(0, 0, -6)
+	nextTime := now.AddDate(0, 0, 1)
+
+	start := time.Date(startTime.Year(), startTime.Month(), startTime.Day(), 0, 0, 0, 0, time.Local)
+	end := time.Date(nextTime.Year(), nextTime.Month(), nextTime.Day(), 0, 0, 0, 0, time.Local)
+
+	if len(s) == 3 {
+		//2006-01-02 00:00:00
+		query_date_tmp, _ := time.Parse("2006-01-02", query_date)
+		queryDateTmp := time.Date(query_date_tmp.Year(), query_date_tmp.Month(), query_date_tmp.Day(), 0, 0, 0, 0, time.Local)
+
+		start = queryDateTmp.AddDate(0, 0, -6) //前6天
+		beego.BeeLogger.Warn("start:%s", start)
+
+		end = queryDateTmp.AddDate(0, 0, 1)
+		beego.BeeLogger.Warn("end:%s", end)
+
+	}
+
+	var days []string
+	var dayCountBdCash []float64
+	list := models.GetTakeBdCashOrderCountByTime(start, end)
+	for i := 0; i < 7; i++ {
+		day := start.AddDate(0, 0, i).Format("01-02")
+		days = append(days, day)
+
+		md := start.AddDate(0, 0, i).Format("20060102")
+		mdInt, _ := strconv.ParseInt(md, 0, 64)
+		dayBdCashOrderCount := models.BdCashDayItemListAndReturnItemCount(mdInt, list)
+		dayBdCashOrderCountYuan := tools.RoundFloat64(float64(dayBdCashOrderCount)/float64(100), 2)
+		dayCountBdCash = append(dayCountBdCash, dayBdCashOrderCountYuan)
+	}
+
+	self.Data["json"] = &Ret{Days: days, BdCashCountList: dayCountBdCash}
+	self.ServeJSON()
+}

+ 28 - 0
go/gopath/src/d5c-statement-api/controllers/d5c_bonus_contoller/bonus_invest.go

@@ -0,0 +1,28 @@
+package d5c_bonus_contoller
+
+import (
+	"github.com/astaxie/beego"
+	"d5c-statement-api/models"
+	"d5c-statement-api/tools"
+)
+
+
+type BonusInvestController struct {
+	beego.Controller
+}
+
+// @Title Get
+// @Description get d5c's investment : 第五创平台的众筹总额(元)
+// @Param	Authorization	header 	string	true	"格式: Token XXXXXX"
+// @Success 200 {object} int64
+// @router / [get]
+func (self *BonusInvestController) Get(){
+	type Ret struct{
+		TotalInvest float64 `json:"total_invest"`
+	}
+
+	total := models.GetD5cTotalProjectJoinInvestment()
+
+	self.Data["json"]= &Ret{TotalInvest: tools.RoundFloat64(float64(total)/float64(100),2)}
+	self.ServeJSON()
+}

+ 0 - 0
go/gopath/src/d5c-statement-api/controllers/d5c_bonus_contoller/bonus_month_invest_and_recharge.go


Некоторые файлы не были показаны из-за большого количества измененных файлов