Commit 99f36b93 authored by 刘琴's avatar 刘琴

新建课程--部分

parent 65c4795d
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7 (GeekInterfaceTest)" jdkType="Python SDK" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="EPYTEXT" />
<option name="myDocStringFormat" value="Epytext" />
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="pytest" />
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (GeekInterfaceTest)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (jk_interface_test) (3)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
......@@ -2,10 +2,16 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ceb24b37-65a1-4b3f-be3f-7040ebc4079d" name="默认变更列表" comment="">
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/Common/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/Common/helpler.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/Course_Data.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/test_case_course.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jk_interface_test.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/jk_interface_test.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/base_api/api_operation_web/order.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/base_api/api_operation_web/order.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/base_api/service_profile/students.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/base_api/service_profile/students.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/script/db_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/db_config.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/run.py" beforeDir="false" afterPath="$PROJECT_DIR$/run.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -23,6 +29,11 @@
<option name="BRANCH" value="origin/liuqin_jyy" />
</component>
<component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="master" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GitSEFilterConfiguration">
......@@ -46,10 +57,13 @@
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/Common" />
<property name="settings.editor.selected.configurable" value="File.Encoding" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\interface\jk_interface_test\script\ji_yun_ying_pc\service_education_liuqin\Common" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/script/ji_yun_ying_pc/mall/store_shopping_mall" />
<recent name="$PROJECT_DIR$/tools" />
......@@ -58,8 +72,8 @@
<recent name="$PROJECT_DIR$/script/ding_ding_jdata/full_class_rate/assert_config" />
</key>
</component>
<component name="RunManager" selected="Python.run_cmd">
<configuration name="debug" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<component name="RunManager" selected="Python.run">
<configuration name="Course_Data" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -67,11 +81,11 @@
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/test" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/test/debug.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/Course_Data.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -80,7 +94,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="init_base_api" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<configuration name="helpler" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="jk_interface_test" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -88,11 +102,11 @@
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/tools" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/Common" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tools/init_base_api.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/Common/helpler.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -165,19 +179,19 @@
<method v="2" />
</configuration>
<list>
<item itemvalue="Python.debug" />
<item itemvalue="Python.init_base_api" />
<item itemvalue="Python.url_to_method" />
<item itemvalue="Python.run" />
<item itemvalue="Python.run_cmd" />
<item itemvalue="Python.Course_Data" />
<item itemvalue="Python.helpler" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python.run_cmd" />
<item itemvalue="Python.run" />
<item itemvalue="Python.Course_Data" />
<item itemvalue="Python.helpler" />
<item itemvalue="Python.run_cmd" />
<item itemvalue="Python.url_to_method" />
<item itemvalue="Python.debug" />
<item itemvalue="Python.init_base_api" />
</list>
</recent_temporary>
</component>
......
......@@ -62,14 +62,14 @@ class RunTest:
if __name__ == '__main__':
case_path_list = [
"./script/ji_yun_ying_pc/system_set/test_basic_parameter_set.py::TestFullClassTargetSet",
"./script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/test_case_course.py::TestCourse::test_create_course_with_all_condition_success",
# "./script/ding_ding_jdata/person_time/test_person_time.py::TestsPersonTimeDetail::test_detail_page_search_date",
# "./script/ding_ding_jdata/person_time/test_person_time.py::TestsPersonTimeDetail::test_detail_page_search_target",
# "./script/ding_ding_jdata/person_time/test_person_time.py::TestsPersonTimeDetail::test_detail_page_search_subject",
]
# host = "https://geek.jkwljy.com"
# account_group = "线上"
host = "http://192.168.32.36"
host = "http://172.10.62.93/"
account_group = "A"
db_config = "36"
mongo_db_config = "36"
......
import random
import time
import datetime
def get_mobile():
"""获取手机号"""
mobile = '1' + random.choice(['3','5','7','8','9'])
for i in range(9):
num = random.randint(0,9)
mobile += str(num)
return mobile
def get_time():
# 获取当前时间cuo
ts =str(int(time.time()))
return ts
def get_now_time():
# 获取当前时间
now_time = time.strftime("%Y-%m-%d %H_%M_%S")
return now_time
def get_tomorrow_datetime():
# 获取明天日期
temp_date = datetime.datetime.now() # 获取当前时间 年月日时分秒
date1 = (temp_date + datetime.timedelta(days=+1)).strftime("%Y-%m-%d %H:%M:%S")
return date1
def get_today():
# 获取今天
today = time.strftime("%Y-%m-%d", time.localtime())
return today
def get_this_week():
# 获取当前日期星期
now = datetime.datetime.now()
this_week_start = now - datetime.timedelta(days=now.weekday())
this_week_end = now + datetime.timedelta(days=6 - now.weekday())
week_start = this_week_start.strftime("%Y-%m-%d")
week_end = this_week_end.strftime("%Y-%m-%d")
return {'week_start':week_start,'week_end':week_end}
def get_this_month():
# 获取当前日期月
now = datetime.datetime.now()
this_month_start = datetime.datetime(now.year,now.month,1)
this_month_end = datetime.datetime(now.year,now.month+1,1) - datetime.timedelta(days=1) + datetime.timedelta(hours=23, minutes=59, seconds=59)
month_start = this_month_start.strftime("%Y-%m-%d")
month_end = this_month_end.strftime("%Y-%m-%d")
return {'month_start':month_start,'month_end':month_end}
def time_transform_day(change_time):
# createTime: 1620387156 转换为2021-05-07 (时间戳转换为日期格式)
day = time.localtime(change_time)
day = time.strftime("%Y-%m-%d", day)
return day
def day_transform_time(change_time):
# createTimeStr: "2021-05-07 19:32:36" 转换为 2021-05-07 (格式转换为日期格式)
timeStruct = time.strptime(change_time, "%Y-%m-%d %H:%M:%S")
timeStruct = time.strftime("%Y-%m-%d", timeStruct)
return timeStruct
if __name__ == '__main__':
print(get_now_time())
# print(get_time())
# # print(get_tomorrow_datetime())
# # print(get_this_week())
# # print(get_this_month())
# print(time_transform_day(1620387156))
# print(day_transform_time("2021-05-07 19:32:36"))
import random
from decimal import Decimal
from script.ji_yun_ying_pc.service_education_liuqin.Common.helpler import get_now_time
class Add_My_New_Clue_isNotTerm():
# 新增课程data,按课时收费
area = 2382
schoolArea = 2371
subject = ("数学", "语文", "英语", "物理", "化学")
classType = (
"极趣班", "极思班", "极智班", "极客班", "极客A班", "极客蓝队班", "五四极趣班", "五四极思班", "五四极智班", "新生", "人教班", "八人精品", "定制班", "五四极客班")
grade_list = ['零年级', '一年级', '二年级', '三年级', '四年级', '五年级', '六年级', '七年级', '八年级', '九年级', '高一', '高二', '高三']
# "courseStatus": "2" 停用 "1" 启用
# "isNormal": 2 低价课程 1 正价课程
def __init__(self, courseName="",
term="暑", subject=random.sample(subject, 1)[0], productType="", year=2021,
classType=random.sample(classType, 1)[0], grade=random.sample(grade_list, 1)[0], coursePeriod="4",
courseType="常规班课",
courseNumber="2", normalPrice="15", coursePrice="15", courseStatus="1", teachForm="offline",
courseDesc="", priceType=1, isTerm=False, perPeriodDuration=1, isNormal=1,
schools=[{"area": area, "schoolArea": schoolArea}], cContent=[]
):
courseName = "【面授】{}{}{}{}[lq]{}".format(term, grade, subject, classType, get_now_time())
self.init_course_data = [
{"courseName": courseName,
"term": term,
"subject": subject,
"productType": productType,
"year": year,
"classType": classType,
"grade": grade,
"coursePeriod": coursePeriod,
"courseType": courseType,
"courseNumber": courseNumber,
"normalPrice": normalPrice,
"coursePrice": coursePrice,
"courseStatus": courseStatus,
"teachForm": teachForm,
"courseDesc": courseDesc,
"priceType": priceType,
"isTerm": isTerm,
"perPeriodDuration": perPeriodDuration,
"isNormal": isNormal,
"totalPrice": float(coursePeriod) * float(coursePrice),
"registerGrade": grade,
"schools": schools,
"cContent": cContent}]
class Add_My_New_Clue_isTerm():
# 新增课程data,按期收费
area = 2382
schoolArea = 2371
subject = ("数学", "语文", "英语", "物理", "化学")
classType = (
"极趣班", "极思班", "极智班", "极客班", "极客A班", "极客蓝队班", "五四极趣班", "五四极思班", "五四极智班", "新生", "人教班", "八人精品", "定制班", "五四极客班")
grade_list = ['零年级', '一年级', '二年级', '三年级', '四年级', '五年级', '六年级', '七年级', '八年级', '九年级', '高一', '高二', '高三']
def __init__(self, courseName="",
term="暑", subject=random.sample(subject, 1)[0], productType="", year=2021,
classType=random.sample(classType, 1)[0], grade=random.sample(grade_list, 1)[0], coursePeriod="3",
courseType="常规班课",
courseNumber="3", normalPrice="100", courseStatus="1", teachForm="offline", totalPrice="44",
courseDesc="", priceType=2, perPeriodDuration=1, isNormal=1,
schools=[{"area": area, "schoolArea": schoolArea}], cContent=[]
):
courseName = "【面授】{}{}{}{}[lq按期]{}".format(term, grade, subject, classType, get_now_time())
self.init_course_data = [
{"courseName": courseName,
"term": term,
"subject": subject,
"productType": productType,
"year": year,
"classType": classType,
"grade": grade,
"coursePeriod": coursePeriod,
"courseType": courseType,
"courseNumber": courseNumber,
"normalPrice": normalPrice,
"coursePrice": '{:.2f}'.format(float(Decimal(totalPrice) / Decimal(coursePeriod))),
"courseStatus": courseStatus,
"teachForm": teachForm,
"courseDesc": courseDesc,
"priceType": priceType,
"perPeriodDuration": perPeriodDuration,
"isNormal": isNormal,
"totalPrice": totalPrice,
"registerGrade": grade,
"schools": schools,
"cContent": cContent}]
if __name__ == '__main__':
totalPrice = Decimal("44")
coursePeriod = Decimal("3")
print(type(str(totalPrice / coursePeriod)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment