Commit f3f4c6c4 authored by Weerasinghe D.N.H's avatar Weerasinghe D.N.H

Revert "Merge branch 'IT19070704' into 'master'"

This reverts merge request !113
parent 5f88aa7d
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/backend" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="database" uuid="22fcd532-5c36-4245-b274-bba2692e10d6">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:D:\Nanduni.Bsc\research_code\2022-158\backend\backend\database.db</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
<libraries>
<library>
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.39.2/sqlite-jdbc-3.39.2.jar</url>
</library>
</libraries>
</data-source>
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="149" name="Python" />
</Languages>
</inspection_tool>
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E128" />
<option value="E501" />
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/backend.iml" filepath="$PROJECT_DIR$/.idea/backend.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -11,7 +11,6 @@ from routes.module_routes import module
from routes.assignment_routes import assignment
from routes.diagram_routes import diagram
from routes.submission_routes import submission
from routes.plagiarism_routes import use_case_diagram_plagiarism
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
......@@ -48,7 +47,6 @@ app.register_blueprint(module)
app.register_blueprint(assignment)
app.register_blueprint(diagram)
app.register_blueprint(submission)
app.register_blueprint(use_case_diagram_plagiarism)
@app.before_first_request
......
class WarehouseOperator:
def Create_Orders_By_Uploading_A_Csv_File(self):
pass
def Make_Adjustments_To_The_Order(self):
pass
def Allocate_A_Vehicle_For_A_Job(self):
pass
def Change_The_System_Suggested_Optimized_Route_If_Required(self):
pass
def Confirm_A_Job(self):
pass
def Change_The_Vehicle_Allocated_For_A_Job(self):
pass
def Export_Information_Of_A_Job_To_Pdf_And_Xls_Format(self):
pass
def Indicate_That_The_Loading_Is_Completed(self):
pass
def Generate_An_Invoice_For_Each_Vehicle(self):
pass
def Generate_Vehicle_Capacity_Utilization_Report(self):
pass
def Generate_Outlet_Wise_Transport_Cost_Report_For_A_Given_Date_Range(self):
pass
def Generate_Vehicle_Turnaround_Time_Report_For_A_Warehouse(self):
pass
def Generate_Cost_Per_1_Kg_Report(self):
pass
def Generate_An_Idle_Time_Limit_Violation_Report(self):
pass
class WarehouseIncharge:
def Confirm_The_Delivered_Items_To_A_Outlet(self):
pass
def Approve_A_Job(self):
pass
def Request_A_Modification_To_The_Planned_Mileage_Of_A_Job(self):
pass
class Admin:
def Approve_The_Planned_Mileage_Modification_Request_Submitted_By_The_Warehouseincharge(self):
pass
def Modify_The_Minimum_Fix_Mileage_Configuration_For_A_Job(self):
pass
def Modify_The_Unloading_Charge(self):
pass
def Update_The_Radius_Limit_From_A_Warehouse_For___Drop_Off___Charges(self):
pass
def Set_Up_The___Drop_Off___Rate_Table_Based_On_Number_Of_Outlets_Visited(self):
pass
def Modify_The___Drop_Off___Rate_Table(self):
pass
def Edit_The_Eligibility_Criteria_For_Driver_Incentive(self):
pass
def Edit_The_Per_Km_Rate_For_An_Existing_Vehicle_Capacity_Type(self):
pass
class WarehouseOperator:
def Create_Orders_By_Uploading_A_Csv_File(self):
pass
def Make_Adjustments_To_The_Order(self):
pass
def Allocate_A_Vehicle_For_A_Job(self):
pass
def Change_The_System_Suggested_Optimized_Route_If_Required(self):
pass
def Confirm_A_Job(self):
pass
def Change_The_Vehicle_Allocated_For_A_Job(self):
pass
def Export_Information_Of_A_Job_To_Pdf_And_Xls_Format(self):
pass
def Indicate_That_The_Loading_Is_Completed(self):
pass
def Generate_An_Invoice_For_Each_Vehicle(self):
pass
def Generate_Vehicle_Capacity_Utilization_Report(self):
pass
def Generate_Outlet_Wise_Transport_Cost_Report_For_A_Given_Date_Range(self):
pass
def Generate_Vehicle_Turnaround_Time_Report_For_A_Warehouse(self):
pass
def Generate_Cost_Per_1_Kg_Report(self):
pass
def Generate_An_Idle_Time_Limit_Violation_Report(self):
pass
class WarehouseIncharge:
def Confirm_The_Delivered_Items_To_A_Outlet(self):
pass
def Approve_A_Job(self):
pass
def Request_A_Modification_To_The_Planned_Mileage_Of_A_Job(self):
pass
class Admin:
def Approve_The_Planned_Mileage_Modification_Request_Submitted_By_The_Warehouseincharge(self):
pass
def Modify_The_Minimum_Fix_Mileage_Configuration_For_A_Job(self):
pass
def Modify_The_Unloading_Charge(self):
pass
def Update_The_Radius_Limit_From_A_Warehouse_For___Drop_Off___Charges(self):
pass
def Set_Up_The___Drop_Off___Rate_Table_Based_On_Number_Of_Outlets_Visited(self):
pass
def Modify_The___Drop_Off___Rate_Table(self):
pass
def Edit_The_Eligibility_Criteria_For_Driver_Incentive(self):
pass
def Edit_The_Per_Km_Rate_For_An_Existing_Vehicle_Capacity_Type(self):
pass
class WarehouseOperator:
def Create_Orders_By_Uploading_A_Csv_File(self):
pass
def Make_Adjustments_To_The_Order(self):
pass
def Allocate_A_Vehicle_For_A_Job(self):
pass
def Change_The_System_Suggested_Optimized_Route_If_Required(self):
pass
def Confirm_A_Job(self):
pass
def Change_The_Vehicle_Allocated_For_A_Job(self):
pass
def Export_Information_Of_A_Job_To_Pdf_And_Xls_Format(self):
pass
def Indicate_That_The_Loading_Is_Completed(self):
pass
def Generate_An_Invoice_For_Each_Vehicle(self):
pass
def Generate_Vehicle_Capacity_Utilization_Report(self):
pass
def Generate_Outlet_Wise_Transport_Cost_Report_For_A_Given_Date_Range(self):
pass
def Generate_Vehicle_Turnaround_Time_Report_For_A_Warehouse(self):
pass
def Generate_Cost_Per_1_Kg_Report(self):
pass
def Generate_An_Idle_Time_Limit_Violation_Report(self):
pass
class WarehouseIncharge:
def Confirm_The_Delivered_Items_To_A_Outlet(self):
pass
def Approve_A_Job(self):
pass
def Request_A_Modification_To_The_Planned_Mileage_Of_A_Job(self):
pass
class Admin:
def Approve_The_Planned_Mileage_Modification_Request_Submitted_By_The_Warehouseincharge(self):
pass
def Modify_The_Minimum_Fix_Mileage_Configuration_For_A_Job(self):
pass
def Modify_The_Unloading_Charge(self):
pass
def Update_The_Radius_Limit_From_A_Warehouse_For___Drop_Off___Charges(self):
pass
def Set_Up_The___Drop_Off___Rate_Table_Based_On_Number_Of_Outlets_Visited(self):
pass
def Modify_The___Drop_Off___Rate_Table(self):
pass
def Edit_The_Eligibility_Criteria_For_Driver_Incentive(self):
pass
def Edit_The_Per_Km_Rate_For_An_Existing_Vehicle_Capacity_Type(self):
pass
digraph "classes_carllodhpj" {
rankdir=BT
charset="utf-8"
"carllodhpj.Admin" [color="black", fontcolor="black", label="{Admin|\l|Approve_The_Planned_Mileage_Modification_Request_Submitted_By_The_Warehouseincharge()\lEdit_The_Eligibility_Criteria_For_Driver_Incentive()\lEdit_The_Per_Km_Rate_For_An_Existing_Vehicle_Capacity_Type()\lModify_The_Minimum_Fix_Mileage_Configuration_For_A_Job()\lModify_The_Unloading_Charge()\lModify_The___Drop_Off___Rate_Table()\lSet_Up_The___Drop_Off___Rate_Table_Based_On_Number_Of_Outlets_Visited()\lUpdate_The_Radius_Limit_From_A_Warehouse_For___Drop_Off___Charges()\l}", shape="record", style="solid"];
"carllodhpj.WarehouseIncharge" [color="black", fontcolor="black", label="{WarehouseIncharge|\l|Approve_A_Job()\lConfirm_The_Delivered_Items_To_A_Outlet()\lRequest_A_Modification_To_The_Planned_Mileage_Of_A_Job()\l}", shape="record", style="solid"];
"carllodhpj.WarehouseOperator" [color="black", fontcolor="black", label="{WarehouseOperator|\l|Allocate_A_Vehicle_For_A_Job()\lChange_The_System_Suggested_Optimized_Route_If_Required()\lChange_The_Vehicle_Allocated_For_A_Job()\lConfirm_A_Job()\lCreate_Orders_By_Uploading_A_Csv_File()\lExport_Information_Of_A_Job_To_Pdf_And_Xls_Format()\lGenerate_An_Idle_Time_Limit_Violation_Report()\lGenerate_An_Invoice_For_Each_Vehicle()\lGenerate_Cost_Per_1_Kg_Report()\lGenerate_Outlet_Wise_Transport_Cost_Report_For_A_Given_Date_Range()\lGenerate_Vehicle_Capacity_Utilization_Report()\lGenerate_Vehicle_Turnaround_Time_Report_For_A_Warehouse()\lIndicate_That_The_Loading_Is_Completed()\lMake_Adjustments_To_The_Order()\l}", shape="record", style="solid"];
}
digraph "classes_pifvanokwc" {
rankdir=BT
charset="utf-8"
"pifvanokwc.Admin" [color="black", fontcolor="black", label="{Admin|\l|Approve_The_Planned_Mileage_Modification_Request_Submitted_By_The_Warehouseincharge()\lEdit_The_Eligibility_Criteria_For_Driver_Incentive()\lEdit_The_Per_Km_Rate_For_An_Existing_Vehicle_Capacity_Type()\lModify_The_Minimum_Fix_Mileage_Configuration_For_A_Job()\lModify_The_Unloading_Charge()\lModify_The___Drop_Off___Rate_Table()\lSet_Up_The___Drop_Off___Rate_Table_Based_On_Number_Of_Outlets_Visited()\lUpdate_The_Radius_Limit_From_A_Warehouse_For___Drop_Off___Charges()\l}", shape="record", style="solid"];
"pifvanokwc.WarehouseIncharge" [color="black", fontcolor="black", label="{WarehouseIncharge|\l|Approve_A_Job()\lConfirm_The_Delivered_Items_To_A_Outlet()\lRequest_A_Modification_To_The_Planned_Mileage_Of_A_Job()\l}", shape="record", style="solid"];
"pifvanokwc.WarehouseOperator" [color="black", fontcolor="black", label="{WarehouseOperator|\l|Allocate_A_Vehicle_For_A_Job()\lChange_The_System_Suggested_Optimized_Route_If_Required()\lChange_The_Vehicle_Allocated_For_A_Job()\lConfirm_A_Job()\lCreate_Orders_By_Uploading_A_Csv_File()\lExport_Information_Of_A_Job_To_Pdf_And_Xls_Format()\lGenerate_An_Idle_Time_Limit_Violation_Report()\lGenerate_An_Invoice_For_Each_Vehicle()\lGenerate_Cost_Per_1_Kg_Report()\lGenerate_Outlet_Wise_Transport_Cost_Report_For_A_Given_Date_Range()\lGenerate_Vehicle_Capacity_Utilization_Report()\lGenerate_Vehicle_Turnaround_Time_Report_For_A_Warehouse()\lIndicate_That_The_Loading_Is_Completed()\lMake_Adjustments_To_The_Order()\l}", shape="record", style="solid"];
}
digraph "classes_pkifwsquqn" {
rankdir=BT
charset="utf-8"
"pkifwsquqn.Admin" [color="black", fontcolor="black", label="{Admin|\l|Approve_The_Planned_Mileage_Modification_Request_Submitted_By_The_Warehouseincharge()\lEdit_The_Eligibility_Criteria_For_Driver_Incentive()\lEdit_The_Per_Km_Rate_For_An_Existing_Vehicle_Capacity_Type()\lModify_The_Minimum_Fix_Mileage_Configuration_For_A_Job()\lModify_The_Unloading_Charge()\lModify_The___Drop_Off___Rate_Table()\lSet_Up_The___Drop_Off___Rate_Table_Based_On_Number_Of_Outlets_Visited()\lUpdate_The_Radius_Limit_From_A_Warehouse_For___Drop_Off___Charges()\l}", shape="record", style="solid"];
"pkifwsquqn.WarehouseIncharge" [color="black", fontcolor="black", label="{WarehouseIncharge|\l|Approve_A_Job()\lConfirm_The_Delivered_Items_To_A_Outlet()\lRequest_A_Modification_To_The_Planned_Mileage_Of_A_Job()\l}", shape="record", style="solid"];
"pkifwsquqn.WarehouseOperator" [color="black", fontcolor="black", label="{WarehouseOperator|\l|Allocate_A_Vehicle_For_A_Job()\lChange_The_System_Suggested_Optimized_Route_If_Required()\lChange_The_Vehicle_Allocated_For_A_Job()\lConfirm_A_Job()\lCreate_Orders_By_Uploading_A_Csv_File()\lExport_Information_Of_A_Job_To_Pdf_And_Xls_Format()\lGenerate_An_Idle_Time_Limit_Violation_Report()\lGenerate_An_Invoice_For_Each_Vehicle()\lGenerate_Cost_Per_1_Kg_Report()\lGenerate_Outlet_Wise_Transport_Cost_Report_For_A_Given_Date_Range()\lGenerate_Vehicle_Capacity_Utilization_Report()\lGenerate_Vehicle_Turnaround_Time_Report_For_A_Warehouse()\lIndicate_That_The_Loading_Is_Completed()\lMake_Adjustments_To_The_Order()\l}", shape="record", style="solid"];
}
digraph G {
rankdir=LR;
labelloc="b";
peripheries=0;
node [shape=plaintext]
subgraph WarehouseOperator {label="WarehouseOperator"; warehouseoperator};
warehouseoperator [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
subgraph WarehouseIncharge {label="WarehouseIncharge"; warehouseincharge};
warehouseincharge [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
subgraph Admin {label="Admin"; admin};
admin [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
node [shape=ellipse, style=solid];
sign_up_to_the_system [label="Sign Up To The System"];
sign_in_to_the_system [label="Sign In To The System"];
create_orders_by_uploading_a_csv_file [label="Create Orders By Uploading A Csv File"];
make_adjustments_to_the_order [label="Make Adjustments To The Order"];
allocate_a_vehicle_for_a_job [label="Allocate A Vehicle For A Job"];
change_the_system_suggested_optimized_route_if_required [label="Change The System Suggested Optimized Route If Required"];
confirm_a_job [label="Confirm A Job"];
change_the_vehicle_allocated_for_a_job [label="Change The Vehicle Allocated For A Job"];
export_information_of_a_job_to_pdf_and_xls_format [label="Export Information Of A Job To Pdf And Xls Format"];
indicate_that_the_loading_is_completed [label="Indicate That The Loading Is Completed"];
confirm_the_delivered_items_to_a_outlet [label="Confirm The Delivered Items To A Outlet"];
approve_a_job [label="Approve A Job"];
request_a_modification_to_the_planned_mileage_of_a_job [label="Request A Modification To The Planned Mileage Of A Job"];
approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge [label="Approve The Planned Mileage Modification Request Submitted By The Warehouseincharge"];
generate_an_invoice_for_each_vehicle [label="Generate An Invoice For Each Vehicle"];
modify_the_minimum_fix_mileage_configuration_for_a_job [label="Modify The Minimum Fix Mileage Configuration For A Job"];
modify_the_unloading_charge [label="Modify The Unloading Charge"];
update_the_radius_limit_from_a_warehouse_for___drop_off___charges [label="Update The Radius Limit From A Warehouse For Drop Off Charges"];
set_up_the___drop_off___rate_table_based_on_number_of_outlets_visited [label="Set Up The Drop Off Rate Table Based On Number Of Outlets Visited"];
modify_the___drop_off___rate_table [label="Modify The Drop Off Rate Table"];
edit_the_eligibility_criteria_for_driver_incentive [label="Edit The Eligibility Criteria For Driver Incentive"];
edit_the_per_km_rate_for_an_existing_vehicle_capacity_type [label="Edit The Per Km Rate For An Existing Vehicle Capacity Type"];
generate_vehicle_capacity_utilization_report [label="Generate Vehicle Capacity Utilization Report"];
generate_outlet_wise_transport_cost_report_for_a_given_date_range [label="Generate Outlet Wise Transport Cost Report For A Given Date Range"];
generate_vehicle_turnaround_time_report_for_a_warehouse [label="Generate Vehicle Turnaround Time Report For A Warehouse"];
generate_cost_per_1_kg_report [label="Generate Cost Per 1 Kg Report"];
generate_an_idle_time_limit_violation_report [label="Generate An Idle Time Limit Violation Report"];
edge [arrowhead="none"];
user->sign_up_to_the_system;
user->sign_in_to_the_system;
warehouseoperator->create_orders_by_uploading_a_csv_file;
warehouseoperator->make_adjustments_to_the_order;
warehouseoperator->allocate_a_vehicle_for_a_job;
warehouseoperator->change_the_system_suggested_optimized_route_if_required;
warehouseoperator->confirm_a_job;
warehouseoperator->change_the_vehicle_allocated_for_a_job;
warehouseoperator->export_information_of_a_job_to_pdf_and_xls_format;
warehouseoperator->indicate_that_the_loading_is_completed;
warehouseincharge->confirm_the_delivered_items_to_a_outlet;
warehouseincharge->approve_a_job;
warehouseincharge->request_a_modification_to_the_planned_mileage_of_a_job;
admin->approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge;
warehouseoperator->generate_an_invoice_for_each_vehicle;
admin->modify_the_minimum_fix_mileage_configuration_for_a_job;
admin->modify_the_unloading_charge;
admin->update_the_radius_limit_from_a_warehouse_for___drop_off___charges;
admin->set_up_the___drop_off___rate_table_based_on_number_of_outlets_visited;
admin->modify_the___drop_off___rate_table;
admin->edit_the_eligibility_criteria_for_driver_incentive;
admin->edit_the_per_km_rate_for_an_existing_vehicle_capacity_type;
warehouseoperator->generate_vehicle_capacity_utilization_report;
warehouseoperator->generate_outlet_wise_transport_cost_report_for_a_given_date_range;
warehouseoperator->generate_vehicle_turnaround_time_report_for_a_warehouse;
warehouseoperator->generate_cost_per_1_kg_report;
warehouseoperator->generate_an_idle_time_limit_violation_report;
edge [arrowtail="vee", label="<<extend>>", style=dashed];
create_orders_by_uploading_a_csv_file->make_adjustments_to_the_order;
confirm_a_job->change_the_vehicle_allocated_for_a_job_change_the_system_suggested_optimized_route_if_required;
edge [arrowtail="vee", label="<<include>>", style=dashed];
confirm_a_job->allocate_a_vehicle_for_a_job;
approve_a_job->confirm_the_delivered_items_to_a_outlet;
request_a_modification_to_the_planned_mileage_of_a_job->approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge;
}
\ No newline at end of file
digraph G {
rankdir=LR;
labelloc="b";
peripheries=0;
node [shape=plaintext]
subgraph WarehouseOperator {label="WarehouseOperator"; warehouseoperator};
warehouseoperator [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
subgraph WarehouseIncharge {label="WarehouseIncharge"; warehouseincharge};
warehouseincharge [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
subgraph Admin {label="Admin"; admin};
admin [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
node [shape=ellipse, style=solid];
sign_up_to_the_system [label="Sign Up To The System"];
sign_in_to_the_system [label="Sign In To The System"];
create_orders_by_uploading_a_csv_file [label="Create Orders By Uploading A Csv File"];
make_adjustments_to_the_order [label="Make Adjustments To The Order"];
allocate_a_vehicle_for_a_job [label="Allocate A Vehicle For A Job"];
change_the_system_suggested_optimized_route_if_required [label="Change The System Suggested Optimized Route If Required"];
confirm_a_job [label="Confirm A Job"];
change_the_vehicle_allocated_for_a_job [label="Change The Vehicle Allocated For A Job"];
export_information_of_a_job_to_pdf_and_xls_format [label="Export Information Of A Job To Pdf And Xls Format"];
indicate_that_the_loading_is_completed [label="Indicate That The Loading Is Completed"];
confirm_the_delivered_items_to_a_outlet [label="Confirm The Delivered Items To A Outlet"];
approve_a_job [label="Approve A Job"];
request_a_modification_to_the_planned_mileage_of_a_job [label="Request A Modification To The Planned Mileage Of A Job"];
approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge [label="Approve The Planned Mileage Modification Request Submitted By The Warehouseincharge"];
generate_an_invoice_for_each_vehicle [label="Generate An Invoice For Each Vehicle"];
modify_the_minimum_fix_mileage_configuration_for_a_job [label="Modify The Minimum Fix Mileage Configuration For A Job"];
modify_the_unloading_charge [label="Modify The Unloading Charge"];
update_the_radius_limit_from_a_warehouse_for___drop_off___charges [label="Update The Radius Limit From A Warehouse For Drop Off Charges"];
set_up_the___drop_off___rate_table_based_on_number_of_outlets_visited [label="Set Up The Drop Off Rate Table Based On Number Of Outlets Visited"];
modify_the___drop_off___rate_table [label="Modify The Drop Off Rate Table"];
edit_the_eligibility_criteria_for_driver_incentive [label="Edit The Eligibility Criteria For Driver Incentive"];
edit_the_per_km_rate_for_an_existing_vehicle_capacity_type [label="Edit The Per Km Rate For An Existing Vehicle Capacity Type"];
generate_vehicle_capacity_utilization_report [label="Generate Vehicle Capacity Utilization Report"];
generate_outlet_wise_transport_cost_report_for_a_given_date_range [label="Generate Outlet Wise Transport Cost Report For A Given Date Range"];
generate_vehicle_turnaround_time_report_for_a_warehouse [label="Generate Vehicle Turnaround Time Report For A Warehouse"];
generate_cost_per_1_kg_report [label="Generate Cost Per 1 Kg Report"];
generate_an_idle_time_limit_violation_report [label="Generate An Idle Time Limit Violation Report"];
edge [arrowhead="none"];
user->sign_up_to_the_system;
user->sign_in_to_the_system;
warehouseoperator->create_orders_by_uploading_a_csv_file;
warehouseoperator->make_adjustments_to_the_order;
warehouseoperator->allocate_a_vehicle_for_a_job;
warehouseoperator->change_the_system_suggested_optimized_route_if_required;
warehouseoperator->confirm_a_job;
warehouseoperator->change_the_vehicle_allocated_for_a_job;
warehouseoperator->export_information_of_a_job_to_pdf_and_xls_format;
warehouseoperator->indicate_that_the_loading_is_completed;
warehouseincharge->confirm_the_delivered_items_to_a_outlet;
warehouseincharge->approve_a_job;
warehouseincharge->request_a_modification_to_the_planned_mileage_of_a_job;
admin->approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge;
warehouseoperator->generate_an_invoice_for_each_vehicle;
admin->modify_the_minimum_fix_mileage_configuration_for_a_job;
admin->modify_the_unloading_charge;
admin->update_the_radius_limit_from_a_warehouse_for___drop_off___charges;
admin->set_up_the___drop_off___rate_table_based_on_number_of_outlets_visited;
admin->modify_the___drop_off___rate_table;
admin->edit_the_eligibility_criteria_for_driver_incentive;
admin->edit_the_per_km_rate_for_an_existing_vehicle_capacity_type;
warehouseoperator->generate_vehicle_capacity_utilization_report;
warehouseoperator->generate_outlet_wise_transport_cost_report_for_a_given_date_range;
warehouseoperator->generate_vehicle_turnaround_time_report_for_a_warehouse;
warehouseoperator->generate_cost_per_1_kg_report;
warehouseoperator->generate_an_idle_time_limit_violation_report;
edge [arrowtail="vee", label="<<extend>>", style=dashed];
create_orders_by_uploading_a_csv_file->make_adjustments_to_the_order;
confirm_a_job->change_the_vehicle_allocated_for_a_job_change_the_system_suggested_optimized_route_if_required;
edge [arrowtail="vee", label="<<include>>", style=dashed];
confirm_a_job->allocate_a_vehicle_for_a_job;
approve_a_job->confirm_the_delivered_items_to_a_outlet;
request_a_modification_to_the_planned_mileage_of_a_job->approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge;
}
\ No newline at end of file
digraph G {
rankdir=LR;
labelloc="b";
peripheries=0;
node [shape=plaintext]
subgraph WarehouseOperator {label="WarehouseOperator"; warehouseoperator};
warehouseoperator [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
subgraph WarehouseIncharge {label="WarehouseIncharge"; warehouseincharge};
warehouseincharge [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
subgraph Admin {label="Admin"; admin};
admin [image="D:\Nanduni.Bsc\research_code\2022-158\backend\backend/stick.png";peripheries=0;];
node [shape=ellipse, style=solid];
sign_up_to_the_system [label="Sign Up To The System"];
sign_in_to_the_system [label="Sign In To The System"];
create_orders_by_uploading_a_csv_file [label="Create Orders By Uploading A Csv File"];
make_adjustments_to_the_order [label="Make Adjustments To The Order"];
allocate_a_vehicle_for_a_job [label="Allocate A Vehicle For A Job"];
change_the_system_suggested_optimized_route_if_required [label="Change The System Suggested Optimized Route If Required"];
confirm_a_job [label="Confirm A Job"];
change_the_vehicle_allocated_for_a_job [label="Change The Vehicle Allocated For A Job"];
export_information_of_a_job_to_pdf_and_xls_format [label="Export Information Of A Job To Pdf And Xls Format"];
indicate_that_the_loading_is_completed [label="Indicate That The Loading Is Completed"];
confirm_the_delivered_items_to_a_outlet [label="Confirm The Delivered Items To A Outlet"];
approve_a_job [label="Approve A Job"];
request_a_modification_to_the_planned_mileage_of_a_job [label="Request A Modification To The Planned Mileage Of A Job"];
approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge [label="Approve The Planned Mileage Modification Request Submitted By The Warehouseincharge"];
generate_an_invoice_for_each_vehicle [label="Generate An Invoice For Each Vehicle"];
modify_the_minimum_fix_mileage_configuration_for_a_job [label="Modify The Minimum Fix Mileage Configuration For A Job"];
modify_the_unloading_charge [label="Modify The Unloading Charge"];
update_the_radius_limit_from_a_warehouse_for___drop_off___charges [label="Update The Radius Limit From A Warehouse For Drop Off Charges"];
set_up_the___drop_off___rate_table_based_on_number_of_outlets_visited [label="Set Up The Drop Off Rate Table Based On Number Of Outlets Visited"];
modify_the___drop_off___rate_table [label="Modify The Drop Off Rate Table"];
edit_the_eligibility_criteria_for_driver_incentive [label="Edit The Eligibility Criteria For Driver Incentive"];
edit_the_per_km_rate_for_an_existing_vehicle_capacity_type [label="Edit The Per Km Rate For An Existing Vehicle Capacity Type"];
generate_vehicle_capacity_utilization_report [label="Generate Vehicle Capacity Utilization Report"];
generate_outlet_wise_transport_cost_report_for_a_given_date_range [label="Generate Outlet Wise Transport Cost Report For A Given Date Range"];
generate_vehicle_turnaround_time_report_for_a_warehouse [label="Generate Vehicle Turnaround Time Report For A Warehouse"];
generate_cost_per_1_kg_report [label="Generate Cost Per 1 Kg Report"];
generate_an_idle_time_limit_violation_report [label="Generate An Idle Time Limit Violation Report"];
edge [arrowhead="none"];
user->sign_up_to_the_system;
user->sign_in_to_the_system;
warehouseoperator->create_orders_by_uploading_a_csv_file;
warehouseoperator->make_adjustments_to_the_order;
warehouseoperator->allocate_a_vehicle_for_a_job;
warehouseoperator->change_the_system_suggested_optimized_route_if_required;
warehouseoperator->confirm_a_job;
warehouseoperator->change_the_vehicle_allocated_for_a_job;
warehouseoperator->export_information_of_a_job_to_pdf_and_xls_format;
warehouseoperator->indicate_that_the_loading_is_completed;
warehouseincharge->confirm_the_delivered_items_to_a_outlet;
warehouseincharge->approve_a_job;
warehouseincharge->request_a_modification_to_the_planned_mileage_of_a_job;
admin->approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge;
warehouseoperator->generate_an_invoice_for_each_vehicle;
admin->modify_the_minimum_fix_mileage_configuration_for_a_job;
admin->modify_the_unloading_charge;
admin->update_the_radius_limit_from_a_warehouse_for___drop_off___charges;
admin->set_up_the___drop_off___rate_table_based_on_number_of_outlets_visited;
admin->modify_the___drop_off___rate_table;
admin->edit_the_eligibility_criteria_for_driver_incentive;
admin->edit_the_per_km_rate_for_an_existing_vehicle_capacity_type;
warehouseoperator->generate_vehicle_capacity_utilization_report;
warehouseoperator->generate_outlet_wise_transport_cost_report_for_a_given_date_range;
warehouseoperator->generate_vehicle_turnaround_time_report_for_a_warehouse;
warehouseoperator->generate_cost_per_1_kg_report;
warehouseoperator->generate_an_idle_time_limit_violation_report;
edge [arrowtail="vee", label="<<extend>>", style=dashed];
create_orders_by_uploading_a_csv_file->make_adjustments_to_the_order;
confirm_a_job->change_the_vehicle_allocated_for_a_job_change_the_system_suggested_optimized_route_if_required;
edge [arrowtail="vee", label="<<include>>", style=dashed];
confirm_a_job->allocate_a_vehicle_for_a_job;
approve_a_job->confirm_the_delivered_items_to_a_outlet;
request_a_modification_to_the_planned_mileage_of_a_job->approve_the_planned_mileage_modification_request_submitted_by_the_warehouseincharge;
}
\ No newline at end of file
import requests
from sqlalchemy import func
from flask import Blueprint, jsonify, request
from constants.http_status_codes_constant import HTTP_200_OK, HTTP_400_BAD_REQUEST, HTTP_201_CREATED, \
HTTP_500_INTERNAL_SERVER_ERROR
from config.database import db
# from datetime import datetime
from models.actor_and_use_case import ActorANDUseCase
from models.extend_relationship import ExtendRelationship
from models.include_relationship import IncludeRelationship
from models.use_case_generalization_relationship import UseCaseGeneralizationRelationship
from models.use_case_association_relationship import UseCaseAssociationRelationship
from models.use_case_answer import UseCaseAnswer
from models.actor_generalization_relationship import ActorGeneralizationRelationship
from services.similarity import similarity_components
use_case_diagram_plagiarism = Blueprint('use_case_diagram_plagiarism', __name__,
url_prefix='/api/v1/use_case_diagram_plagiarism')
@use_case_diagram_plagiarism.get('/similarities')
def get_use_case():
extent_component = None
include_component = None
user_case_association_component = None
user_cases_generalization_component = None
actor_generalization_component = None
actor_association_component = None
includes = IncludeRelationship.query.all()
extents = ExtendRelationship.query.all()
user_cases = ActorANDUseCase.query.all()
user_case_associations = UseCaseAssociationRelationship.query.all()
user_cases_generalizations = UseCaseGeneralizationRelationship.query.all()
actor_generalizations = ActorGeneralizationRelationship.query.all()
for user_case in user_cases:
if user_case.type == "use case":
for extent in extents:
if user_case.id == extent.connected_component_01:
extent_component = user_case
similarity_components(extent_component.use_case_answer, extent_component.text)
print("Extend component 1 : ", extent_component.text)
elif user_case.id == extent.connected_component_02:
extent_component = user_case
similarity_components(extent_component.use_case_answer, extent_component.text)
print("Extend component 2 : ", extent_component.text)
for include in includes:
if user_case.id == include.connected_component_01:
include_component = user_case
similarity_components(include_component.use_case_answer, include_component.text)
print("Include component 1 : ", include_component.text)
elif user_case.id == include.connected_component_02:
include_component = user_case
similarity_components(include_component.use_case_answer, include_component.text)
print("Include component 2 : ", include_component.text)
for user_case_association in user_case_associations:
if user_case.id == user_case_association.connected_component_01:
user_case_association_component = user_case
similarity_components(user_case_association_component.use_case_answer,
user_case_association_component.text)
print("User cases association component 1 : ", user_case_association_component.text)
elif user_case.id == user_case_association.connected_component_02:
user_case_association_component = user_case
similarity_components(user_case_association_component.use_case_answer,
user_case_association_component.text)
print("User cases association component 2 : ", user_case_association_component.text)
for user_cases_generalization in user_cases_generalizations:
if user_case.id == user_cases_generalization.connected_component_01:
user_cases_generalization_component = user_case
similarity_components(user_cases_generalization_component.use_case_answer,
user_cases_generalization_component.text)
print("User cases generalization Component 1 : ", user_cases_generalization_component.text)
elif user_case.id == user_cases_generalization.connected_component_02:
user_cases_generalization_component = user_case
similarity_components(user_cases_generalization_component.use_case_answer,
user_cases_generalization_component.text)
print("User cases generalization Component 2 : ", user_cases_generalization_component.text)
elif user_case.type == "actor":
for actor_generalization in actor_generalizations:
if user_case.id == actor_generalization.connected_component_01:
actor_generalization_component = user_case
similarity_components(actor_generalization_component.use_case_answer,
actor_generalization_component.text)
print("Actor generalization component 1 : ", actor_generalization_component.text)
elif user_case.id == actor_generalization.connected_component_02:
actor_generalization_component = user_case
similarity_components(actor_generalization_component.use_case_answer,
actor_generalization_component.text)
print("Actor generalization component 2 : ", actor_generalization_component.text)
for actor_association in user_case_associations:
if user_case.id == actor_association.connected_component_01:
actor_association_component = user_case
similarity_components(actor_association_component.use_case_answer,
actor_association_component.text)
print("Actor association component 1 : ", actor_association_component.text)
elif user_case.id == actor_association.connected_component_02:
actor_association_component = user_case
similarity_components(actor_association_component.use_case_answer,
actor_association_component.text)
print("Actor association component 2 : ", actor_association_component.text)
return jsonify({"Message": "Success"}), HTTP_200_OK
@use_case_diagram_plagiarism.get('/use_case_plagiarism_percentage')
def get_actor():
user_cases = ActorANDUseCase.query.all()
use_case_answers = UseCaseAnswer.query.all()
all_count = db.session.query(ActorANDUseCase.use_case_answer,
func.count(ActorANDUseCase.use_case_answer)).group_by(
ActorANDUseCase.use_case_answer).all()
actor_similarity = db.session.query(ActorANDUseCase.use_case_answer,
func.count(ActorANDUseCase.plagiarism_count)).filter_by(
plagiarism_count=1).group_by(
ActorANDUseCase.use_case_answer).all()
for use_case_answer in use_case_answers:
print(use_case_answer.id)
counter = 0
counter1 = 0
for user_case in user_cases:
if user_case.use_case_answer == use_case_answer.id:
counter += 1
if user_case.plagiarism_count == "1":
counter1 += 1
print("All use cases and actors count :", counter)
print("similarity count :", counter1)
if counter != 0:
plagirism_count = counter1/counter * 100
print("Plagiarism Percentage :", plagirism_count)
return jsonify({"Message": "Success"}), HTTP_200_OK
from models.actor_and_use_case import ActorANDUseCase
from config.database import db
def similarity_components(use_case_answer, use_case_text):
user_cases = ActorANDUseCase.query.all()
for use_case1 in user_cases:
if use_case1.use_case_answer != use_case_answer and use_case1.text == use_case_text:
use_case1.plagiarism_count = 1
db.session.add(use_case1)
db.session.commit()
......@@ -15,9 +15,15 @@ from models.class_relationship_muplicity import Multiplicity
def detect_class_relationship(image_nparray, boxes, index, class_comp_id, category):
# image = cv2.imread(app.SUBMISSION_PATH + '/' + filename)
height, width, c = image_nparray.shape
class_objects = Component.query.filter_by(class_answer=class_comp_id).all()
# for i in range(0, len(accurate_indexes))
# if category_index[class_id[i]]['name'] != 'class' and category_index[class_id[i]]['name'] != 'interface':
# category_name = category_index[class_id[i]]['name']
ymin = boxes[index][0] * height
xmin = boxes[index][1] * width
ymax = boxes[index][2] * height
......@@ -238,13 +244,20 @@ def relationship_details_detection(image_nparray, boxes, index, class_comp_id, c
if result is not None:
relationship_text(_image, result, relationship)
# print(relationship, 'relationship')
def relationship_text(_image, result, relationship):
# boxes = [res[0] for res in result]
# texts = [res[1][0] for res in result]
# scores = [res[1][1] for res in result]
for element in result:
text = element[1][0]
box = element[0]
nlp_ner = spacy.load('ner_models/model-best')
nlp_output = nlp_ner(text)
# print(text, 'line 290')
# box = np.array(box,dtype=float)
box = np.array(box).astype(np.int32)
xmin = min(box[:, 0])
......@@ -252,6 +265,8 @@ def relationship_text(_image, result, relationship):
xmax = max(box[:, 0])
ymax = max(box[:, 1])
for token in nlp_output.ents:
# print(token.text, 'line 301')
# print(token.label_, 'line 302')
if token.label_ == 'MULTIPLICITY' or contains_number(text):
multiplicity = Multiplicity(value=token.text, relationship_id=relationship.id, x_min=xmin,
......@@ -272,12 +287,14 @@ def contains_number(string):
# crop image using boxes & index
def crop_image_(image, boxes, index):
height, width, c = image.shape
# crop box format: xmin, ymin, xmax, ymax
ymin = boxes[index][0] * height
xmin = boxes[index][1] * width
ymax = boxes[index][2] * height
xmax = boxes[index][3] * width
cropped_image = image[int(ymin):int(ymax), int(xmin):int(xmax)]
# image = cv2.cvtColor(cropped_image, cv2.COLOR_BGR2GRAY)
# image = cv2.resize(image, (800, 500))
# returns cropped image , ymin,xmin,ymax & xmax
return cropped_image, ymin, xmin, ymax, xmax
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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