作者 bianxinhua

add README

... ... @@ -2,21 +2,14 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="d6814b48-28ec-40b6-bcea-dcd9b8613715" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/api/app_api/order/intentions_api.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/testcases/order/order_intentions_testcases.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/api/app_api/dividend/statistics_api.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/testcases/dividend/dividend_statistics_testcases.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/app_api/order/list_0_api.yml" beforeDir="false" afterPath="$PROJECT_DIR$/api/app_api/order/list_0_api.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/app_api/order/list_1_api.yml" beforeDir="false" afterPath="$PROJECT_DIR$/api/app_api/order/list_1_api.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/app_api/order/list_2_api.yml" beforeDir="false" afterPath="$PROJECT_DIR$/api/app_api/order/list_2_api.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/api/m_api/actual/m_add_order_actual_api.yml" beforeDir="false" afterPath="$PROJECT_DIR$/api/m_api/actual/m_add_order_actual_api.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/accessToken.csv" beforeDir="false" afterPath="$PROJECT_DIR$/config/accessToken.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/authCode.csv" beforeDir="false" afterPath="$PROJECT_DIR$/config/authCode.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/m_accessToken.csv" beforeDir="false" afterPath="$PROJECT_DIR$/config/m_accessToken.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/refreshToken.csv" beforeDir="false" afterPath="$PROJECT_DIR$/config/refreshToken.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/debugtalk.py" beforeDir="false" afterPath="$PROJECT_DIR$/debugtalk.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/helpfunc/pg_app_db_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/helpfunc/pg_app_db_func.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/testcases/actual/ACTUAL001_add_actual_testcases.yml" beforeDir="false" afterPath="$PROJECT_DIR$/testcases/actual/ACTUAL001_add_actual_testcases.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/testcases/order/order_list_2_testcases.yml" beforeDir="false" afterPath="$PROJECT_DIR$/testcases/order/order_list_2_testcases.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/testcases_excel/partner_api.xlsx" beforeDir="false" afterPath="$PROJECT_DIR$/testcases_excel/partner_api.xlsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/testsuites/partner_testsuite.yml" beforeDir="false" afterPath="$PROJECT_DIR$/testsuites/partner_testsuite.yml" afterDir="false" />
</list>
... ... @@ -27,8 +20,8 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/partner_api$debugtalk.coverage" NAME="debugtalk Coverage Results" MODIFIED="1595000563833" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/partner_api$pg_app_db_func.coverage" NAME="pg_app_db_func Coverage Results" MODIFIED="1595001825451" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/helpfunc" />
<SUITE FILE_PATH="coverage/partner_api$debugtalk.coverage" NAME="debugtalk Coverage Results" MODIFIED="1595174406299" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/partner_api$pg_app_db_func.coverage" NAME="pg_app_db_func Coverage Results" MODIFIED="1595128904097" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/helpfunc" />
<SUITE FILE_PATH="coverage/partner_api$db_pg_func.coverage" NAME="db_pg_func Coverage Results" MODIFIED="1594485069390" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/helpfunc" />
<SUITE FILE_PATH="coverage/partner_api$pg_db_func.coverage" NAME="pg_db_func Coverage Results" MODIFIED="1594826376790" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/helpfunc" />
</component>
... ... @@ -37,17 +30,17 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/testsuites/partner_testsuite.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="26">
<caret line="47" selection-start-line="47" selection-end-line="47" />
<state relative-caret-position="127">
<caret line="101" column="32" selection-start-line="101" selection-start-column="32" selection-end-line="101" selection-end-column="32" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/helpfunc/pg_app_db_func.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="358">
<caret line="326" lean-forward="true" selection-start-line="326" selection-end-line="326" />
<state relative-caret-position="22">
<caret line="7" column="20" selection-start-line="7" selection-start-column="20" selection-end-line="7" selection-end-column="20" />
<folding>
<element signature="e#108#123#0" expanded="true" />
</folding>
... ... @@ -55,23 +48,32 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/debugtalk.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="155">
<caret line="86" lean-forward="true" selection-start-line="86" selection-end-line="86" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/api/m_api/actual/m_add_order_actual_api.yml">
<entry file="file://$PROJECT_DIR$/api/app_api/dividend/statistics_api.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="19" column="27" selection-start-line="19" selection-start-column="27" selection-end-line="19" selection-end-column="27" />
<state relative-caret-position="220">
<caret line="16" column="38" lean-forward="true" selection-start-line="16" selection-start-column="38" selection-end-line="16" selection-end-column="38" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/debugtalk.py">
<entry file="file://$PROJECT_DIR$/testcases/dividend/dividend_statistics_testcases.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="95" lean-forward="true" selection-start-line="95" selection-end-line="95" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
<state relative-caret-position="176">
<caret line="8" column="19" selection-start-line="8" selection-start-column="19" selection-end-line="8" selection-end-column="19" />
</state>
</provider>
</entry>
... ... @@ -99,6 +101,8 @@
<find>allShipmentQuantity</find>
<find>get_allShipmentQuantity_from_database</find>
<find>intentionQuantity</find>
<find>received</find>
<find>outstanding</find>
</findStrings>
</component>
<component name="Git.Settings">
... ... @@ -107,8 +111,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/testcases/admin/ADMIN001_add_admin_testcases.yml" />
<option value="$PROJECT_DIR$/testcases/admin/ADMIN002_edit_admin_testcases.yml" />
<option value="$PROJECT_DIR$/testcases/admin/ADMIN004_detail_admin_testcases.yml" />
<option value="$PROJECT_DIR$/testcases/admin/ADMIN005_forbidden_admin_testcases.yml" />
<option value="$PROJECT_DIR$/testcases/admin/ADMIN006_forbidden_admin_testcases.yml" />
... ... @@ -154,10 +156,12 @@
<option value="$PROJECT_DIR$/testcases/order/order_list_2_testcases.yml" />
<option value="$PROJECT_DIR$/api/app_api/order/intentions_api.yml" />
<option value="$PROJECT_DIR$/testcases/order/order_intentions_testcases.yml" />
<option value="$PROJECT_DIR$/testsuites/partner_testsuite.yml" />
<option value="$PROJECT_DIR$/api/m_api/actual/m_add_order_actual_api.yml" />
<option value="$PROJECT_DIR$/debugtalk.py" />
<option value="$PROJECT_DIR$/testcases/dividend/dividend_statistics_testcases.yml" />
<option value="$PROJECT_DIR$/testsuites/partner_testsuite.yml" />
<option value="$PROJECT_DIR$/helpfunc/pg_app_db_func.py" />
<option value="$PROJECT_DIR$/api/app_api/dividend/statistics_api.yml" />
<option value="$PROJECT_DIR$/debugtalk.py" />
</list>
</option>
</component>
... ... @@ -208,19 +212,6 @@
<path>
<item name="partner_api" type="b2602c69:ProjectViewProjectNode" />
<item name="partner_api" type="462c0819:PsiDirectoryNode" />
<item name="api" type="462c0819:PsiDirectoryNode" />
<item name="m_api" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="partner_api" type="b2602c69:ProjectViewProjectNode" />
<item name="partner_api" type="462c0819:PsiDirectoryNode" />
<item name="api" type="462c0819:PsiDirectoryNode" />
<item name="m_api" type="462c0819:PsiDirectoryNode" />
<item name="actual" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="partner_api" type="b2602c69:ProjectViewProjectNode" />
<item name="partner_api" type="462c0819:PsiDirectoryNode" />
<item name="helpfunc" type="462c0819:PsiDirectoryNode" />
</path>
<path>
... ... @@ -253,16 +244,16 @@
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="E:\mmm_auto\partner_api\api\m_api\purpose" />
<recent name="E:\mmm_auto\partner_api\api\m_api\partners" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="E:\mmm_auto\partner_api\testcases\dividend" />
<recent name="E:\mmm_auto\partner_api\api\app_api\dividend" />
<recent name="E:\mmm_auto\partner_api\testcases\order" />
<recent name="E:\mmm_auto\partner_api\api\app_api\order" />
<recent name="E:\mmm_auto\partner_api\api\m_api\purpose" />
<recent name="E:\mmm_auto\partner_api\testcases\purpose" />
<recent name="E:\mmm_auto\partner_api\testcases\actual" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="E:\mmm_auto\partner_api\api\m_api\purpose" />
<recent name="E:\mmm_auto\partner_api\api\m_api\partners" />
</key>
</component>
<component name="RunDashboard">
... ... @@ -277,7 +268,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.pg_app_db_func">
<component name="RunManager" selected="Python.debugtalk">
<configuration name="db_pg_func" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="partner_api" />
<option name="INTERPRETER_OPTIONS" value="" />
... ... @@ -368,8 +359,8 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python.pg_app_db_func" />
<item itemvalue="Python.debugtalk" />
<item itemvalue="Python.pg_app_db_func" />
<item itemvalue="Python.pg_db_func" />
<item itemvalue="Python.db_pg_func" />
</list>
... ... @@ -400,18 +391,22 @@
<workItem from="1594868693482" duration="7846000" />
<workItem from="1594914151652" duration="1652000" />
<workItem from="1594948652577" duration="13932000" />
<workItem from="1595040709032" duration="2762000" />
<workItem from="1595086198970" duration="85000" />
<workItem from="1595128430644" duration="1114000" />
<workItem from="1595171971122" duration="2398000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="113978000" />
<option name="totallyTimeSpent" value="120337000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1382" height="744" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Favorites" order="0" side_tool="true" />
<window_info content_ui="combo" id="Project" order="1" visible="true" weight="0.3161876" />
<window_info content_ui="combo" id="Project" order="1" visible="true" weight="0.33661118" />
<window_info id="Structure" order="2" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Docker" order="0" show_stripe_button="false" />
<window_info anchor="bottom" id="Terminal" order="1" weight="0.44974446" />
... ... @@ -420,7 +415,7 @@
<window_info anchor="bottom" id="Find" order="4" weight="0.32879046" />
<window_info anchor="bottom" id="Python Console" order="5" weight="0.32879046" />
<window_info anchor="bottom" id="Database Changes" order="6" />
<window_info anchor="bottom" id="Run" order="7" weight="0.3270869" />
<window_info active="true" anchor="bottom" id="Run" order="7" visible="true" weight="0.3270869" />
<window_info anchor="bottom" id="Version Control" order="8" weight="0.32879046" />
<window_info anchor="bottom" id="Debug" order="9" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
... ... @@ -437,20 +432,6 @@
<option name="version" value="1" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/testcases/partners/PARTNERS002_edit_partner_testcases.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="88">
<caret line="4" column="61" selection-start-line="4" selection-start-column="61" selection-end-line="4" selection-end-column="61" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/testcases/partners/PARTNERS003_list_partner_testcases.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="88">
<caret line="4" column="61" selection-start-line="4" selection-start-column="61" selection-end-line="4" selection-end-column="61" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/testcases/partners/PARTNERS004_list_partner_testcases.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="88">
... ... @@ -766,39 +747,53 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/testsuites/partner_testsuite.yml">
<entry file="file://$PROJECT_DIR$/api/m_api/actual/m_add_order_actual_api.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="26">
<caret line="47" selection-start-line="47" selection-end-line="47" />
<state relative-caret-position="81">
<caret line="9" column="9" selection-start-line="9" selection-start-column="9" selection-end-line="9" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/m_api/actual/m_add_order_actual_api.yml">
<entry file="file://$PROJECT_DIR$/testcases/dividend/dividend_statistics_testcases.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="19" column="27" selection-start-line="19" selection-start-column="27" selection-end-line="19" selection-end-column="27" />
<state relative-caret-position="176">
<caret line="8" column="19" selection-start-line="8" selection-start-column="19" selection-end-line="8" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/debugtalk.py">
<entry file="file://$PROJECT_DIR$/testsuites/partner_testsuite.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="95" lean-forward="true" selection-start-line="95" selection-end-line="95" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
<state relative-caret-position="127">
<caret line="101" column="32" selection-start-line="101" selection-start-column="32" selection-end-line="101" selection-end-column="32" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/helpfunc/pg_app_db_func.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="358">
<caret line="326" lean-forward="true" selection-start-line="326" selection-end-line="326" />
<state relative-caret-position="22">
<caret line="7" column="20" selection-start-line="7" selection-start-column="20" selection-end-line="7" selection-end-column="20" />
<folding>
<element signature="e#108#123#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/app_api/dividend/statistics_api.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220">
<caret line="16" column="38" lean-forward="true" selection-start-line="16" selection-start-column="38" selection-end-line="16" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/debugtalk.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="155">
<caret line="86" lean-forward="true" selection-start-line="86" selection-end-line="86" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
... ...
name: 分红统计
base_url: ${ENV(base_url)}
variables:
currtime: ${make_time()}
uuid: ${make_uuid()}
var_access_token: ${get_accesstoken()}
sign: ${make_sign($currtime, $uuid, $var_access_token)}
received: ${get_received_from_database()}
outstanding: ${get_outstanding_from_database()}
startTime: ${get_January_timestamp()}
endTime: ${get_Decembe_timestamp()}
msg: 成功
request:
headers:
Content-Type: application/json;charset=utf-8
User-Agent: okhttp/3.12.3
X-MMM-AccessToken: $var_access_token
X-MMM-AppName: com.mmm.ability
X-MMM-AppProject: ability
X-MMM-DeviceType: '1'
X-MMM-Sign: $sign
X-MMM-Timestamp: $currtime
X-MMM-Uuid: $uuid
X-MMM-Version: 0.4.0
json:
startTime: $startTime
endTime: $endTime
method: POST
url: v1/dividend/statistics
validate:
- eq:
- content.msg
- $msg
- eq:
- content.data.statistics.received
- $received
- eq:
- content.data.statistics.outstanding
- $outstanding
\ No newline at end of file
... ...
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjI5LCJleHAiOjE1OTQ5NjM4NDAsImlzcyI6Imp3dCJ9.0vRdFJBZ-KAl4i6VfyveyWfSD77efIuNAeiQWp1rmTU
\ No newline at end of file
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjI5LCJleHAiOjE1OTUxODE2NDksImlzcyI6Imp3dCJ9.040kthvHTswNtk9W6N2BY2pqWdpcp010TCDcxUzsgoU
\ No newline at end of file
... ...
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjI5LCJleHAiOjE1OTQ5NTc1NDAsImlzcyI6Imp3dCJ9.vviFgl2MmnN9J8q1swQcsMoe84XMLe4f0X5BfSTc_Oc
\ No newline at end of file
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjI5LCJleHAiOjE1OTUxNzUzNDksImlzcyI6Imp3dCJ9.pg_SIaCWY8Sq1NY_eoyiRqZBXvtOGxxAD0W9rMtZ2_c
\ No newline at end of file
... ...
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjI5LCJleHAiOjE1OTc1NDg2NDAsImlzcyI6Imp3dCJ9.DvDeRgMC2P6LDoCwBOXY6b5UvHy87dThhokOhK_rdrE
\ No newline at end of file
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjI5LCJleHAiOjE1OTc3NjY0NDksImlzcyI6Imp3dCJ9.ppsxSGGy7O0fwk-QGlBlkAYn2gwhxEMaqlU3yzioBaA
\ No newline at end of file
... ...
... ... @@ -79,17 +79,19 @@ def get_starTimestamp():
def get_endTimestamp():
return int(time.mktime(time.strptime(list_time[1], '%Y-%m-%d %H:%M:%S'))*1000)
# def get_date_timestamp(date):
# return int(time.mktime(time.strptime(date, '%Y-%m-%d %H:%M:%S'))*1000)
def get_January_timestamp():
return int(time.mktime(time.strptime('2020-01-01 00:00:00', '%Y-%m-%d %H:%M:%S'))*1000)
import time
import datetime
def get_Decembe_timestamp():
return int(time.mktime(time.strptime('2020-12-31 23:59:59', '%Y-%m-%d %H:%M:%S'))*1000)
def get_date_timestamp():
begin = int(time.mktime(time.strptime(f'{datetime.datetime.now().year}-01-01 0:0:0', '%Y-%m-%d %H:%M:%S'))*1000)
end = int(time.mktime(time.strptime(f'{datetime.datetime.now().year}-12-31 23:59:59', '%Y-%m-%d %H:%M:%S')))
return begin, end
# def get_date_timestamp():
# begin = int(time.mktime(time.strptime(f'{datetime.datetime.now().year}-01-01 0:0:0', '%Y-%m-%d %H:%M:%S'))*1000)
# end = int(time.mktime(time.strptime(f'{datetime.datetime.now().year}-12-31 23:59:59', '%Y-%m-%d %H:%M:%S'))*1000)
# print(begin,end)
# return begin, end
print("{:.2f}".format(1/6))
# print(get_Decembe_timestamp())
# # '2020-12-31 23:59:59'
\ No newline at end of file
... ...
... ... @@ -7,7 +7,6 @@ import psycopg2
from datetime import date, timedelta
import datetime,time
def get_today():
now_today = datetime.datetime.now()
str_time = now_today.strftime("%Y-%m-%d")
... ... @@ -291,36 +290,41 @@ def get_intentionQuantity_from_database(tbl):
db.rollback()
db.close()
#累计所有年份未收分红
def get_outstanding_from_database(tbl):
def get_outstanding_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select COALESCE(sum(((order_actual_amount - order_payment_amount ) * partner_bonus_percent)/100),0) as outstanding from \"{}\" where partner_id = {} and create_at between \'{}\' and \'{}\' '''.format(tbl,get_partner_id_from_database('partner_info'),get_starTimestamp(),get_endTimestamp())
sql = '''select COALESCE(sum(((order_actual_amount - order_payment_amount ) * partner_bonus_percent)/100),0) as outstanding from \"{}\" where partner_id = {} and create_at between \'{}\' and \'{}\' '''.format('order',get_partner_id_from_database('partner_info'),get_starTimestamp(),get_endTimestamp())
# print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return round(result[0],2)
if round(result[0], 2) == 0:
return 0
else:
return round(result[0],2)
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
#累计所有年份已收分红
def get_received_from_database(tbl):
def get_received_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select COALESCE(sum((order_payment_amount * partner_bonus_percent)/100),0) as received from \"{}\" where partner_id = {} and create_at between \'{}\' and \'{}\' '''.format(tbl,get_partner_id_from_database('partner_info'),get_starTimestamp(),get_endTimestamp())
sql = '''select COALESCE(sum((order_payment_amount * partner_bonus_percent)/100),0) as received from \"{}\" where partner_id = {} and create_at between \'{}\' and \'{}\' '''.format('order',get_partner_id_from_database('partner_info'),get_starTimestamp(),get_endTimestamp())
# print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return round(result[0],2)
if round(result[0],2) == 0:
return 0
else:
return round(result[0],2)
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
print(get_received_from_database('order'))
# print(get_outstanding_from_database())
... ...
config:
name: 分红统计
base_url: ${ENV(base_manager_url)}
variables:
phone: ${get_partner_account_from_database(partner_info)}
received: ${get_received_from_database()}
outstanding: ${get_outstanding_from_database()}
teardown_hooks:
- ${sleep(3)}
teststeps:
- name: $phone 登录系统
testcase: testcases/login_testcases.yml
- name: $phone 分红统计
api: api/app_api/dividend/statistics_api.yml
validate:
- eq:
- content.msg
- $msg
- eq:
- content.data.statistics.received
- $received
- eq:
- content.data.statistics.outstanding
- $outstanding
\ No newline at end of file
... ...
... ... @@ -46,10 +46,10 @@ testcases:
#- name: PARTNERS006:启用合伙人
# testcase: testcases/partners/PARTNERS007_set-status_partner2_testcases.yml
#
- name: ACTUAL001:新增实际订单
testcase: testcases/actual/ACTUAL001_add_actual_testcases.yml
parameters:
account: ${create_phone_number(1)}
#- name: ACTUAL001:新增实际订单
# testcase: testcases/actual/ACTUAL001_add_actual_testcases.yml
# parameters:
# account: ${create_phone_number(1)}
#
#- name: ACTUAL002:编辑实际订单
# testcase: testcases/actual/ACTUAL002_edit_actual_testcases.yml
... ... @@ -96,4 +96,7 @@ testcases:
# testcase: testcases/order/order_list_2_testcases.yml
#- name: intentions:意向订单列表
# testcase: testcases/order/order_intentions_testcases.yml
\ No newline at end of file
# testcase: testcases/order/order_intentions_testcases.yml
- name: statistics:分红统计
testcase: testcases/dividend/dividend_statistics_testcases.yml
\ No newline at end of file
... ...